One of the most useful aspects of Integrated Development Environments (IDE), like Zend Studio or Eclipse PDT, is the ability to obtain code completion information when typing PHP source.
Regrettably, however, none of these IDEs is by default instrumented to provide code completion for PHP-GTK developers. But there is a way to make them seem PHP-GTK-aware.
These IDEs are able to provide code completion not only for prebuilt extension code, but also for user-level PHP code. This gives us a way to provide it to PHP-GTK developers : all it takes is a "stub" file containing PHP declarations equivalent to the PHP-GTK2 classes, interfaces, and their methods and constants.
Due to the sheer volume of the PHP-GTK API, it is out of the question to build such a stub file by hand, as this would be too much work and almost immediately obsolete, but luckily the PHP5 Reflection API enables reverse-engineering the PHP-GTK extension interface back to a PHP file that will be mostly equivalent to the original API.
The attached Gtk_Dumper script produces such a stub file.
php-gtk-skeletons.php, preferably in a separate directory.There are a few limitations due to differences between C (in which GTK and PHP extensions are coded), and PHP itself:
Traversable Interface, which can simply not be created in user PHP code. The prototypes are therefore missing it, but the information is available as comments in the stub fileforeach() and unset() are replaced by foreach_method and unset_method() wherever they are appear. Remove _method in your PHP-GTK programsGdk::XOR, Gdk::AND and Gdk::OR are replaced by Gdk::XOR_Blit, Gdk::<code>AND_Blit, and Gdk::OR_Blit respectively. Remove _Blit in your PHP-GTK programs| Attachment | Size |
|---|---|
| php-gtk-prototypes.zip | 58.14 KB |
| Gtk_Dumper.php.txt | 24.92 KB |
Recent comments
47 weeks 3 days ago
48 weeks 2 days ago
48 weeks 6 days ago
51 weeks 2 days ago
1 year 19 weeks ago
1 year 23 weeks ago
1 year 27 weeks ago
1 year 27 weeks ago
1 year 27 weeks ago
1 year 44 weeks ago