Announcing PHP-GTK
whyDNA? sends us this news bit: "I found this on the PHP page: The first release of PHP-GTK is now available. PHP-GTK is a PHP extension that provides an object-oriented interface to GTK+ toolkit and enables you to write client-side cross-platform GUI applications. For more information, visit gtk.php.net."
I agree with your first comment. Outside of browser applets, my view on Java is: "what's the point?". Especially for server-side stuff...
But, PHP is interpreted, too. There's nothing necessarily wrong with interpreted languages, particularly for DB-based apps where the SQL engine and queries are the bottleneck. For small apps or for rapid development, interps allow for fast code-then-run loops. May not be an adequate method for kernel coding, but for gotta-be-done-yesterday business apps it makes a difference. Also, I believe both PHP and Java have caching products that will speed them up once development is over and you need more performance.
Of course, I believe the original poster misunderstood the point of the story... PHP-GTK is not intended to run in a web browser. This is intended for local apps using the php command-line interpreter to quickly create GUI apps, similar to Perl-Gtk, Python-Gtk, etc...
It's called "room for growth". It's not a bad thing. Otherwise, all those people who learned PHP will discover that they wasted their time when they run into the limits of the language.
We try to push everything (languages, OS's, apps) to try to be everything to everyone. PHP is great for what it is. If you want to create a GUI, use something that was built for it the ground up for it.
Oh, piff! With the exception of Visual Basic and kindred proprietary RAD languages, there are no significant languages out there that were "designed from the ground up" for GUIs. (Java is arguable, but still...) I'm not even sure what it would mean for a language to be designed for GUIs, or how it would differ from any existing procedural or OO language. Make window a reserved word? Whatever.
The fact of the matter is that most GUI API's are grotesquely complex and present a steep learning curve for a beginner or someone who just wants to write a simple graphical frontend for a tool. Tcl/Tk has heretofore been the only exception worthy of note, but Tcl has its own host of problems including limited compatibility between versions and its DOS-batch-language-gone-wild syntax. Python is probably a better language (than PHP or Tcl), but PHP has the advantage of presenting a gentler learning curve for anyone who already knows C, minus all of the implicit syntax that makes Perl so difficult for newbies.
If you want to create an interactive database driven website (and you don't know perl) use PHP.
PHP is a lot easier to use than mod_perl or Mason for lightweight tasks. I use all of the above, and only use Perl when the situation is sufficiently complex to call for it. It's also a helluva lot easier to configure.
I hope this doesn't ever work itself into the main distribution of PHP... More bloat.
Consider learning to edit your makefiles if it ever does. A Gtk extension to PHP would only be appropriate to the standalone build, not the Apache module.
--
Proud member of the Weirdo-American community.
What language used to own it?
In a sense, HTML used to "own" PHP just as it effectively owns EcmaScript. Go to OSDN SourceForge and follow any of the Show Source links at the bottom of the pages.
All your hallucinogen are belong to us.
Will I retire or break 10K?
I'm pretty sure you're getting this totally wrong.
;-)
This is nothing to do with using PHP in web pages at all. In fact, it's nothing to do with web pages.
This about using PHP as a script interpreter, just like you use perl or python as a script interpreter.
So this certainly won't allow you to embed GTK applications in web pages: that would be neat, but would require a browser-plugin at the client end, and require the PHP code to be send to the client end. So the client would need the PHP interpreter.
It won't allow you to embed gtkhtml in IE, either
Jules
-- Any sufficiently advanced technology is indistinguishable from a perl script.
well, disclaimer IANALP (I am not a Linux programmer). I'll tell you one use for it. Most of our C++ coders in our Microsoft shop use VB for playing around with a new library/version/whatever. They prototype functions in VB then bounce them to C++ later. Or maybe they decide that, performance isn't a key issue in this COM object (like it's dependent on database access or other disk access for speed) and can just as easily stay in VB without a performance penalty and hand off the object (usually with an interface defined) to one of the VB programmers like me :)
Just thought I'd give you the view from the other side :)
---
DO NOT DISTURB THE SE
(Don't tell anybody, but to be honest, it's been more a matter of feeling too lazy to download it and mess with it than a licensing issue. Quite frankly, I don't have a huge problem with the QPL, as much as I'd prefer to see it GPL'd. I just haven't felt that my code was running too slow at the moment...)
Wait a minute...did I just say "don't tell anybody" in the middle of a public slashdot post? Must be getting late. Can I go home yet? :-)
---
"They have strategic air commands, nuclear submarines, and John Wayne. We have this"
Hacker Public Radio is our Friend
If so, I already yelled at you. If not, well...FOOEY ON YOU!
Hey, here's a thought, why not run a "Make the Best Widgets for Slashdot" Campaign?
Winner enters the circle of advanced moderators, and gets Rob's autograph on any shirt from Think Geek.
"Yeah...it was the numbers that were irrational, not the murderous cult of vegetarians...." -- Hippasus of Metapontum
So as I understand it then, you are free to choose either license?
That makes sense.. I thought the previous poster was implying that both licenses had to be satisfied.. which is counter to GPL.
Then again, as the compelte copyright holder, they can release it under whatever bizarre licenses they want, it just might mean nobody's technically allowed to use it.
Looks like PHP is looking to become a "real" language. Good to see. Our library folks wrote a time-card entry system using swipe cards with PHP and didn't know squat about the language when the wrote it. It's a great language for beginners and experts alike
If you aren't part of the solution, there is good money to be made prolonging the problem
What? Qt is the Trolltech widget set and is available under the GPL for non-commercial development. And what has OO got to do with the quality of the language? Somebody mod this down as -2 (Dumbass)
However, there's still a lot you can do very easily with PHP and a DB backend, whether it's Oracle, PostgreSQL or MySQL. We've got stuff like a web-based coursework submissions system I hacked together using PHP and Postgres. PHP is a damn good language and very easy to learn if you've had any exposure to perl; a lot of the syntax and usage is similar, even easier under PHP.
--
Only Americans are stupid enough to use PHP, eh? That's funny, I know more European PHP users than American ones. Not to mention how many members of the PHP Group are European.
And then of course, there's the proliferation of PHP sites in Europe.
It will not make it into the main PHP distribution. That's why I set it up as a separate CVS module and with a separate webpage and release schedule.
-Andrei
Perhaps if you don't consider the performance hit. From all of the figures I've seen, PHP is much faster than perl. Especially on websites. Mod_Perl does speed things up by a HUGE margin, but unfortunatly my company does not allow webservers other than Netscape/iPlanet Enterprise... so we must run our perl script CGIs the old fashioned slow way. If you know of any way around this, it would be of help! We do like perl!
Don't get me wrong, I love PHP - I wrote "BlackNova Traders" using PHP and MySQL... and the language rocks for web programming... but that was its intended use.
I don't want to see PHP lose its focus and purpose - it isn't a general use language... if you want one, there are plenty (C/C++, perl, and even java for example). PHP is meant for dynamic kick-ass web-page creation.
BlackNova Traders
We try to push everything (languages, OS's, apps) to try to be everything to everyone. PHP is great for what it is. If you want to create a GUI, use something that was built for it the ground up for it. If you want to create an interactive database driven website (and you don't know perl) use PHP.
I hope this doesn't ever work itself into the main distribution of PHP... More bloat. My webserver doesn't like it already...
Gyp.
Not exactly a strong testament to Gimp (although it's more the artist's fault).
- I don't care if they globalize against free speech. All my best free thoughts are done in my head.
I'm reasonably sure you're looking at this all wrong. I don't think this is related to web browsing at all. I think it's just a means of letting you use GTK+ from *any* PHP script. That would place it in the same class as dtksh, tcl/tk, tkperl, or tkpython.
"The invisible and the non-existent look very much alike." -- Delos B. McKown
Uh, there was a commercial FastCGI module available for the Netscape servers. Does the same thing most people use mod_perl for: it allows slightly-modified CGI code to be compiled and cached by a persistent Perl interpreter.
The only problem is that it was sold to another company, which was in turn acquired, and it was taken off the market. You may want to contact Adero to see if they'd be so kind as to point you in the right direction.
If you're running the Netscape/iPlanet webserver on NT or Win2K, you can also use ActiveState's PerlEx, which is another similar persistent-Perl engine.
There also appears to be a reasonably modern Perl NSAPI module, which is philosophically the closest thing to mod_perl in that it lets you get close to the metal and write true server modules in Perl. It's here.
Velocigen, another commercial product, isn't exclusively a Perl engine. It's a logic and content caching engine that uses XML tags that can hook to cached and embedded code--including Perl. It's probably a different development experience from these other systems, but if persistent Perl is your goal, this should do it too.
Ever tried searching the Web?
Would this fit the bill? Being that I can almost directly translate PHP to ASP and vice versa, and that ASP is the web language descendent of VB, does this mean we now have a VB for Linux? If so, cool!
No, Thursday's out. How about never - is never good for you?
if this is what it says, gtk bindings to php -- so you can write desktop apps in gtk using the php scripts hitting a database...that's awfully cool.
reminds me of oractcl...it would be nice to have some SCREENSHOTS of the thing doind financial stuff.
after all, i don't think the road to world domination is paved with games and 3d...it appears to flow from corporate use.
show it doing corporate things, damn it!!!
Treatment, not tyranny. End the drug war and free our American POWs.
See my user info for links.
Basically, it looks like it's "free but not GPL". (Personally, I don't have a philosophical problem with the "give us credit if you use our code" clause of the license, but that's me.)
The Zend Optimizer (which is optional, and a separate but related product, isn't it?) apparently uses the QPL according to the Gnu page mentioned above, which is the license that used to be used by QT and got the flamewars about the "freeness" of KDE going, wasn't it?
My personal solution is to go ahead and use PHP, but not bother with the separate Zend Optimizer download.
---
"They have strategic air commands, nuclear submarines, and John Wayne. We have this"
Hacker Public Radio is our Friend
How can something be availableu nder the GPL for non-commercial development. the GPL forbids such restrictions.
And if you do want to start insulting, please only speak for yourself. I'm European and I don't want American PHP coders to think I find them stupid.
(I could go on and on about how the Internet should be international and free from any regional prejudices, but i won't, i'm pretty sure everybody but you gets that)
I'm the author of PHPTriad and would like to point out that I've got a testing version of PHPTriad 2.0 available which I consider much more stable and complete than the version that download.com is pointing to. It's linked from a news story on www.phpgeek.com.
LetterJ
Head Geek
The Glass is Too Big: My Take on Things
you got the wrong guy.
www.php.net
and you can look at www.phpbuilder.com too for tutorials
Personally, I love (in the platonic sense, you sickos!...) PHP. I'm looking forward to playing with this new stuff.
Just a few random comments/opinions on some issues that have come up here:
The "but it's not GPL!" issue seems to revolve around two things. One is that there is a clause in the license for PHP that says, to paraphrase, "if you use any of our code for something else, give us credit". This is apparently GPL-incompatible, but I don't personally have a moral problem with this. The other licensing issue is the Zend stuff, which when dealt with separate from PHP is under a different, more restrictive license (the "Zend Optimizer" which if I remember right is a separate product, is under the much-maligned QPL, apparently.
I tend to think of PHP as "PERL-lite". It's not as big or "full-featured" as PERL is, and is therefore of more limited (but more focused!) use. PHP does have what to me seems to be a very PERL-like syntax, though. Perhaps one might think of PHP as "Programming marijuana" which leads to escalation to Harder programming languages like PERL* :-). Like PERL, PHP can be worked with in either Object Oriented or standard Procedural ways (or a combination thereof), and both are similar (though I must admit I'm still slightly baffled on PERL OO - PHP doesn't use anything like bless(), for example...)
It LOOKS like "PHP-gtk" and the standard PHP will be separate projects, which is probably good, as it should keep bloat down while allowing each project to borrow relevant improvements from each other.
Mind you, I think the "bloat" issue is mostly nonexistent. The Linux Kernel itself might be considered extremely bloated...except that running "make config" "de-bloatifies" it by setting up to only compile what you need or want. PHP will almost certainly remain the same way.
Maybe now somebody will come up with a "flash authoring" tool for Linux using PHP's swf support (I've been wanting to "dabble" with flash animation, but I don't know of any linux tools for putting them together...)
(* - It's a joke! Really! No, I'm NOT trying to start a "war on drugs" flamewar!)---
"They have strategic air commands, nuclear submarines, and John Wayne. We have this"
Hacker Public Radio is our Friend
www.php.net (and download the manual... its my bible)
:)
also www.devshed.com
---------------
100% Australian
Hey, cool! What better language to write a GUI version of EDLIN in that we've all been wanting for so long? :-)
---
"They have strategic air commands, nuclear submarines, and John Wayne. We have this"
Hacker Public Radio is our Friend
... an icon so completely just copied off the PHP page...
- - - - -
Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
What do you mean? What language used to own it? I don't understand...
I'm a PHP guy, though I've been preferring Python lately. I still really like PHP.
Use this one. It's the same as the one you're useing but anti-aliased especially for you.
how is this a troll? someone compares java to php, i point out the stengths versus weaknesses, and BAM it's a troll.
Pearl would be much better suited for this type of application, due to its strong typing and oo-features.
I didn't know there was a strongly typed language called Pearl. Is it anything like the weakly typed language called Perl?
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
Those words are computer jargon, but I wouldn't call them buzzwords.
--
Qt, like many other very common packages like Ghostscript[1] is available under two licenses. The Qt code is identical, but the GPL version can only be used to develop GPLed applications (duh, that's the point of the GPL). The QPL version gives you the source without the restrictions of the GPL, so people can write Windows, Mac or Linux apps that can be distributed under their choice of license (including traditional commercial licenses).
So, yes it is dual licensed, GPL for Free Software purists, and QPL for Open Source purists. I really can't think of another company that has gone to greater lengths to satisfy the community and has gotten a worse rep for licenses.
[1] Of course, Ghostview releases the source under GPL a few versions behind the commerically available version. Qt's source is up to date on both sides of the license.
--
Evan
"$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
Have you ever written a GUI in Java? Swing is still a horrible pile of crap.
The GTK toolkit for Windows is rather stable in my experience. I've used it with an IDE and for some MySQL tools on nt4 and 2000. It isn't yet used very often, but that doesn't mean that a) it doesn't exist or b) it isn't stable.
I think this is great news. I've been dealing with signed Java applets for years now, and they're a needlessly difficult thing.
Well since its php related, I setup a mirror incase of any slashdot like effect. This seems really useful. the mirror is locate here:http://dev.sig.mine.nu/~jbardin/php-gtk-0.0.1 .tar.gz. I hope this helps.
behold the power of SiG.
Jon Bardin
Yeah, seriously, I mean... this license ISN'T THE GPL. Somebody get a rope. [/sarcasm]
Why is OO the holy grail? Why does everything have to be done by the GPL? Why must everything that comes out fit into the little box that you find acceptable?
Oh good grief. What were they thinking when they named it?
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
There are times when a dynamic web site needs to do stuff in the background, or on a regular schedule, or without worrying about a browser timeout, independent of whether the site is being accessed.
For example, on an auction site you might want to have a script that runs once every minute to close out auctions that just ended, and email announcements to the seller and highest bidder.
Or you might want to update the weather forecast on your home page every hour by downloading a page from National Weather Service, parsing it, and inserting the info into a database.
Running PHP shell scripts from cron is great for that sort of thing. It allows one to develop the whole site in the same language, instead of switching to Perl or bash for the background stuff.
Not that any of this has anything to do with PHP-GTK...
--
Go to your php source directory. Do ls ext/. Look at all of it and think, "Gee, look at all these extensions which I can choose to compile into my php binary, leave out alltogether, or build as shared modules." PHP will never be any more bloated than you want it to be because almost everything outside of the core language and server interfaces are modules.
It's not incorperated, it's an add on dynamically loaded module. Geez, it's a simple concept really... And even if the php folks rolled it into the dev tree, as long as you don't compile with --enable-gtk, who the hell cares if it's there or not? It won't affect your server, you can just pretend it doesn't exist.
Apparently, PHP-GTK gets by with linking to version 4 because GTK is released under the LGPL.
I'm surprised Richard Stallman hasn't released a blistering condemnation of the project yet.
The Web is like Usenet, but
the elephants are untrained.
Thus you could open a mozilla browser from within IE.
Sure.
:-(], which should be pretty explanatory.
www.php.net/manual. The manual is great. You can learn everything you need to know about specific things from there. Before that, you need a basic tutorial.
A PHP page looks like this:
<html>
<title>Hello</title>
<form action=<?php print $PHP_SELF; ?>
<input name=message>
<input type=submit>
</form>
<?php
print $message;
?>
Try that. Also, to get hold of PHP, use PHP Triad (on Linux, you can probably install it from your distribution CD), a win32 installer of PHP, Apache and MySQL.
Basically:
PHP is HTML with the code embedded between blocks starting
<?php
and ending
?>
within that you put your PHP code.
For example:
<?php
print "hello";
?>
would display hello - just like perl.
Similarly, as in Perl, variables are preceded by $.
So:
<?php
$message="chese";
print "I like $message";
?>
It's convenient - all form variables get put into variables of the same name:
<form action=apage.php>
<input name=thing>
<input type=submit name=action value=Submit>
</form>
would send apage.php two variables - $action='Submit'; and $thing= whatever you typed in there.
You should investigate PHP's object-orientation functions too. Here's an example class [class omitted due to slashdot's lameness filter
Anyway, start here; read here for more, as well as here. Also subscribe to the mailing list at php-general@lists.php.net for help from others.
--
Hi!