How to find all PHP funtions/classes/constants

php.internals

Peter Hodge

19 years ago
Hello everyone, I am in the process of updating the PHP syntax file for Vim, and I need to gather a list of all built-in PHP functions, constants, classes, interfaces, and preferably also the methods and class-constants from said built-in classes and interfaces. First I used my PHP's get_defined_functios() and similar classes to havest my list, but this misses out on any extensions I don't have compiled. Second, I tried to scan the PHP manual, but this is time consuming and not 100% accurate (page layout is very inconsistent). Does anyone know if it would be effective to 'grep' the PHP source code to find all these built-in words? regards, Peter Send instant messages to your online friends http://au.messenger.yahoo.com

Rasmus Lerdorf

19 years ago
Peter Hodge wrote:
> Hello everyone, > > I am in the process of updating the PHP syntax file for Vim, and I need to > gather a list of all built-in PHP functions, constants, classes, interfaces, > and preferably also the methods and class-constants from said built-in classes > and interfaces. > > First I used my PHP's get_defined_functios() and similar classes to havest my > list, but this misses out on any extensions I don't have compiled. > > Second, I tried to scan the PHP manual, but this is time consuming and not 100% > accurate (page layout is very inconsistent). > > Does anyone know if it would be effective to 'grep' the PHP source code to find > all these built-in words?
phpdoc/scripts in cvs -Rasmus

Derick Rethans

19 years ago
On Sat, 28 Oct 2006, Peter Hodge wrote:
> Hello everyone, > > I am in the process of updating the PHP syntax file for Vim, and I need to > gather a list of all built-in PHP functions, constants, classes, interfaces, > and preferably also the methods and class-constants from said built-in classes > and interfaces. > > First I used my PHP's get_defined_functios() and similar classes to havest my > list, but this misses out on any extensions I don't have compiled.
The following suffers from the same problems, but also shows constants, ini settings, classes etc: for i in `php -r 'foreach(get_loaded_extensions() as $ext) { echo "$ext "; }';`; do php --re $i; done regards, Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

Peter Hodge

19 years ago
--- Derick Rethans <derick@php.net> wrote:
> On Sat, 28 Oct 2006, Peter Hodge wrote: > > > Hello everyone, > > > > I am in the process of updating the PHP syntax file for Vim, and I need to > > gather a list of all built-in PHP functions, constants, classes, > interfaces, > > and preferably also the methods and class-constants from said built-in > classes > > and interfaces. > > > > First I used my PHP's get_defined_functios() and similar classes to havest > my > > list, but this misses out on any extensions I don't have compiled. > > The following suffers from the same problems, but also shows constants, > ini settings, classes etc: > > for i in `php -r 'foreach(get_loaded_extensions() as $ext) { echo "$ext "; > }';`; do php --re $i; done
That's the problem, I want information from *all* stable PHP extensions (except perhaps the Experimental ones). If it's in the manual on php.net, then I want Vim to recognize it. I'm especially after the constants and Interface names/methods. (I've found the function/class/method names in the Function Index in the manual, so they're OK now). Yes, I can dig through the manual myself, but I really want to automate this process so I don't have to do it repeatedly. regards, Peter Send instant messages to your online friends http://au.messenger.yahoo.com

Nuno Lopes

19 years ago
> That's the problem, I want information from *all* stable PHP extensions > (except > perhaps the Experimental ones). If it's in the manual on php.net, then I > want > Vim to recognize it. I'm especially after the constants and Interface > names/methods. (I've found the function/class/method names in the > Function > Index in the manual, so they're OK now). > > Yes, I can dig through the manual myself, but I really want to automate > this > process so I don't have to do it repeatedly. > > regards, > Peter
The way to go is to parse the PHP sources directly. Thats the only way if you want up-to-date information. Search for example for REGISTER_*_CONSTANT() or PHP_FE() macros. Nuno

Diego do Nascimento Feitosa

19 years ago
Hi Peter, I already have an updated syntax file...I grab all information using the Reflection API. My file includes the PHP-GTK 2 alpha and PHP 5.1.4 methods, constants and functions. You can find this at http://download.dnfeitosa.com/misc/php.vim.gz Regards, Diego Peter Hodge escreveu: