PHP_Compat::loadVersion

PEAR Manual


API

API -- Application Programming Interface

Parsing data sources

You can parse multiple data sources :

Call one of these five functions, with or without options, and you will retrieve a hash which contains information:

  • ignored_functions, PHP functions list that were ignored during source code parsing.

  • ignored_extensions, PHP extensions list that were ignored during source code parsing.

  • ignored_constants, PHP constants list that were ignored during source code parsing.

  • max_version, maximum PHP version to run source code.

  • version, minimum PHP version to run source code.

  • extensions, PHP modules/extensions functions found in source code.

  • constants, PHP constants found in source code.

  • tokens, PHP5 tokens (public, final, abstract, etc )

  • cond_code, A level (and details) of warning about conditional code found during parsing source code: from 0=none, 1=function_exists, 2=extension_loaded, 4=defined

    Its binary value, so 5 means defined+function_exists, and so on ...

Parser options

Each of five parsing functions support common and specifics options :

Common options
debug

Contains a boolean to control whether extra ouput is shown.

ignore_functions

Contains an array of functions to ignore when calculating the version needed.

ignore_constants

Contains an array of constants to ignore when calculating the version needed.

ignore_extensions

Contains an array of php extensions to ignore when calculating the version needed.

ignore_versions

Contains an array of php versions to ignore when calculating the version needed.

ignore_functions_match

Excludes from scope all functions that match (full or partially) the pattern(s).

ignore_extensions_match

Excludes from scope all extensions that match (full or partially) the pattern(s).

ignore_constants_match

Excludes from scope all constants that match (full or partially) the pattern(s).

parseArray, parseDir|parseFolder, specific options
file_ext

Contains an array of file extensions to parse for PHP code. Default: php, php4, inc, phtml

ignore_files

Contains an array of files to ignore. File names are case insensitive.

parseArray specific options
is_string

Contains a boolean which says if the array values are strings or file names.

parseDir|parseFolder specific options
recurse_dir

Boolean on whether to recursively find files.

ignore_dirs

Contains an array of directories to ignore. Directory names are case insensitive.




PHP_Compat::loadVersion

PEAR Manual