Background: PHP allows providers to disable functions (directive "disable_functions"). So in order to get to know if your project is running on a specific server you'll have to check:
- What built-in (=excluding user-defined) functions is your to-be-deployed project using?
- Are the functions available on the specific host?
(Question (2) is a trivial loop over the result (1) with function_exists
.)
In order to get the harvesting working (=a mostly complete set of built-in functions used on the development servers) one could create a list of functions with get_loaded_extensions()
, get_extension_funcs()
and get_defined_functions()
(and access it's 'internal' array for the built-in functions).
Now the question: How would you extract/grep the built-in PHP functions used in the project from your (possibly hundreds of) source files?
It could be a nice PERL job or somethig like that. How would you do it?