If you need PHP3 detection, DO NOT use version 1.5.0 or greater, but the latest release of 1.4 branch (1.4.3)
Initial PEAR public release: occured in March 2003, one month later after package proposal was launched under name PHP_Compatibility
Added the ability to ignore files: in PHP_CompatInfo::parseFolder() and PHP_CompatInfo::parseArray()
Added the ability to ignore folders: in PHP_CompatInfo::parseFolder()
Added the ability to ignore functions: in all public methods.
Added a command line interface: with new class PHP_CompatInfo_Cli
Added a clone function: to PHP_CompatInfo::parseFolder() named PHP_CompatInfo::parseDir(). parseFolder() became now an alias of parseDir().
Added new option file_ext for parseArray: This option contains an array of file extensions to parse for PHP code. Default: php, php4, inc, phtml
Fixed integration with PEAR_PackageFileManager: PackageFileManager::detectDependencies() implement call to PHP_CompatInfo and allow to detect easily minimum PHP version needed.
Improved PHP5 detection: one year after first PEAR public release, stable version 1.0.0 fixed some bugs and also allow PHP3 script/function detection.
Added support for reporting max PHP version: came with user request 6056
Improved PECL detection: especially with SAPI extension.
Added new option ignore_constants: to PHP_CompatInfo::parseArray(), PHP_CompatInfo::parseDir(), PHP_CompatInfo::parseFolder(), PHP_CompatInfo::parseFile(), PHP_CompatInfo::parseString(),
Load components list for a PHP version or subset: added new function PHP_CompatInfo::loadVersion() to API
Improved command line interface: output is limited to 80 columns for a better render. There is also now a windows launcher (named compatinfo.bat).
package xml 1.0: was stopped to be generated on version 1.3.2 (september 2006)
Inactive leader: Davey Shafik, initial author of this package, became inactive, and I (Laurent Laville) follow his steps as new active package leader.
PHP 4.3.0: is now required as a minimum to use both web and cli interfaces.
License upgrade: from PHP 3.0 to PHP 3.01
Improved PHP5 detection: with some bug fixes
Improved PHP5 detection: with new data source version.xml (revision 1.8) and funclist.txt (revision 1.39).
Dropped support of PHP3 detection: due to content of new data source version.xml (1.8) and funclist.txt (1.39)
Command line interface: under windows (pci.bat) and unix (pci.php) have now unified name. Idea came from PHP_CodeSniffer package that allow to fix lot of errors/warnings of coding standard.
Debug output of CLI gave now origin of extension (from PECL or not) and minimum extension version (rather than PHP). See example docs/examples/checkExtensions.php
Improved PHP5 detection: with data source version.xml (revision 1.9) and funclist.txt (revision 1.39).
More PHP constant are detected natively:
Some Core Predefined Constants ( PHP_EOL, DIRECTORY_SEPARATOR, PATH_SEPARATOR, E_STRICT )
Date Predefined Constants ( DATE_* )
CLI Specific Constants ( STD* )
File Upload Error Specific Constants ( UPLOAD_ERR_* )
Command line interface: allow now to detect version of a simple string (code without using script tags <?php ... ?>. Uses new parameter -s or --string.
Command line interface: allow now to print either an xml or text report (default). Uses new parameter -r or --report.
loadVersion() may return both function or function+constant list.
PHP method chaining is implemented on "Davey Shafik" request #13094.
Fix CLI output render to 80 columns, on main table :
29 characters for File/Path column
9 characters for Version column
3 characters for C column (conditional code level)
12 characters for Extensions column
20 characters for Constants/Tokens column
Fix CLI output render to 80 columns, on additionnal tables :
25 characters for Option column
51 characters for Value column
Improved detection on conditionnal code: with new options : ignore_functions_match, ignore_extensions_match, ignore_constants_match.
That allow to implement request 12857 : add the option to locally mask exceptions.
Implement request 13138 : separate constants and tokens in results.
Implement request 13147 : add filter file extension option on parsing directory (CLI)
On CLI, the XML report generation is now xml compliant with a root tag (pci)
Warning |
XML format is incompatible with version 1.6.x |
ability to know conditional code (such as function_exists) used by php scripts. A level (and details) of warning about conditional code found during parsing source code is available for all interface (including command line : with new column C)
On CLI text report is customizable with new --output-level switch. Path/File+Version are always given on minimum report (0), until full details (max:15 - default).
On CLI you may now summarize the result with new --summarize switch. Remove extra lines for all files when parsing a directory.
Rewrites of core API following the MVC pattern came from a user request that wanted to customized its CLI output. Even if output-level switch already exists, there is no easy way with no process-logic dependency.
A word about the new architecture: Parser logic may be found in class PHP_CompatInfo_Parser, while PHP_CompatInfo class is still the main controller, but just a wrapper to parser methods. Each output format (csv, xml, text, html, array, null) is produced by an independant renderer ( PHP_CompatInfo_Renderer_Csv, PHP_CompatInfo_Renderer_Xml, PHP_CompatInfo_Renderer_Text, PHP_CompatInfo_Renderer_Html, PHP_CompatInfo_Renderer_Array, PHP_CompatInfo_Renderer_Null ) with the common interface PHP_CompatInfo_Renderer
To create your own renderer or just customize a bit an exists renderer, please have a look on example named pci180_parsedir_tohtml.php
Here are the list of news and changes since previous API:
Always display result on standard output. To disable this feature, see the FAQ entry About new API 1.8.0.
2 news output format. With the new renderer system, the Web SAPI may use the xml render (until now limited to CLI). While there is two news render: csv and html. Default output format (PHP dump array) use the array render while text is for CLI.
A common method to parse all data sources. The new method PHP_CompatInfo::parseData() allow to parse all data source (array, string, file, directory) with the same interface. All others PHP_CompatInfo::parse* functions become now alias of this new method (to keep backward compatibility).
Event-driven architecture allow multiple renderer and extending core API of PHP_CompatInfo.
Progress bar for long process. Ability to display simple text wait message or a progress bar when parsing directories (or lot of files) from the command line, and even on web interface.
Constant E_RECOVERABLE_ERROR introduced with PHP 5.2.0, is now detected.