![]() PHP_CompatInfo : The Definitive Guide |
At the beginning of first version that catch conditional code, there
were only 3 options: ignore_functions
,
ignore_extensions
and ignore_constants
.
Incovenient with these options, is that you should know the source code to parse, and identify whose functions, extensions or constants to avoid.
Version 1.7.0 of API has introduced the ability to add name patterns to
identify all or part of functions, extensions, constants to ignore from
parsing. You should use now these options: ignore_functions_match
, ignore_extensions_match
or ignore_constants_match
.
Let's take a look with an example, how it's easy to catch whatever you want to exclude from parsing. We will take again example of PEAR::HTML_CSS 1.5.1 package already seen in advanced directory detection.
Here we catch all standard conditional code (function_exists
, extension_loaded
, defined
) what match all names (regular expression
given by array('/.*/')
).
![]() |
Tip |
---|---|
To catch what ever function you want, use
It's also true for With preg_match you are really free to ignore a single function, a group set or all functions, only by giving the good name pattern. |
Example to ignore all functions prefixed by xdebug_ :
PHP_CompatInfo : The Definitive Guide | v 1.8.0 : August 1, 2008 |