PHP_CompatInfo_Parser::parseData

PHP_CompatInfo_Parser::parseData() – Parse a data source

Synopsis

require_once 'PHP/CompatInfo/Parser.php';

array PHP_CompatInfo_Parser::parseData ( mixed $dataSource , array $options = array() )

Description

Parse a data source with auto detect ability. This data source, may be one of these follows: a directory, a file, a string (chunk of code), an array of multiple origin.

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' Contains an array of function patterns to ignore when calculating the version needed.

  • 'ignore_extensions_match' Contains an array of extension patterns to ignore when calculating the version needed.

  • 'ignore_constants_match' Contains an array of constant patterns to ignore when calculating the version needed.

* 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.

Parameter

mixed $dataSource

The data source (may be file, dir, string, or array)

array $options

An array of options. See above.

Return value

returns array or false on error

Throws

throws no exceptions thrown

Since

since version 1.8.0b2 (2008-06-03)

Note

This function can not be called statically.

Example

see PHP_CompatInfo::parseData() example