News

News – What is New in version ?

Choose the right version

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)

Version 0.7.x

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

Version 0.8.x

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

Version 1.0.x

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

Version 1.1.x

  • Added support for reporting max PHP version: came with user request 6056

  • Improved PECL detection: especially with SAPI extension.

Version 1.2.x

  • 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

Version 1.3.x

  • 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)

Version 1.4.x

  • 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

Version 1.5.x

  • 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

Version 1.6.x

  • Improved PHP5 detection: with data source version.xml (revision 1.9) and funclist.txt (revision 1.39).

    More PHP constant are detected natively:

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

Version 1.7.x

  • 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)

    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.

Version 1.8.x

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 package.php.php-compatinfo.faq.php.

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

Version 1.9.x

With API 1.8.0, there is a limit in class (internal, and end-user defined) detection. This limit is also valuable for lot of constants and PHP extensions.

API 1.8.0 detected PHP4 classes constructors as simple functions, that produce wrong results, especially if class name is also an extension function. Example: HTTP_Request class from PEAR package may be also found into pecl_http extension.

API 1.9.0 introduce a 3 categories dictionary system: class, constant and function.

  • class dictionary $GLOBALS['_PHP_COMPATINFO_CLASS'] found into CompatInfo/class_array.php file

  • constant dictionary $GLOBALS['_PHP_COMPATINFO_CONST'] found into CompatInfo/const_array.php file

  • function dictionary $GLOBALS['_PHP_COMPATINFO_FUNCS'] found into CompatInfo/func_array.php file

Each dictionary can include data from 0 to N extensions depending of your need of detection (and/or platform running).

Extensions Support List (aka ESL) default built include following 30 extensions:

  • bcmath
  • calendar
  • ctype
  • date
  • dom
  • filter
  • ftp
  • gd
  • gettext
  • hash
  • iconv
  • json
  • libxml
  • mbstring
  • mysql
  • mysqli
  • openssl
  • pcre
  • pgsql
  • session
  • SimpleXML
  • SPL
  • SQLite
  • standard
  • tokenizer
  • wddx
  • xml
  • xmlreader
  • xmlwriter
  • xsl

PHP4 users may extend this list by hand and construct their own with other available extensions provided into package distribution.

PHP5 users may also extend this list by hand, but there is a script named pciconf (pciconf.bat for Windows users) that can simplify the build process.

API 1.9.0 provided also new methods to retrieve easily information from array results, global or for a specific file in results list. These methods are:

  • getVersion Minimum (and or maximal) PHP Version

  • getClasses All classes (internal or end-user defined)

  • getFunctions All functions (internal or end-user defined)

  • getExtensions All extensions (internal or external)

  • getConstants All constants (internal or end-user defined)

  • getTokens All PHP5+ tokens

  • getConditions All (warning) code conditions

  • getIgnoredFiles List of files ignored during parsing data source

  • getIgnoredFunctions List of functions (user or PHP internal) ignored during parsing data source

  • getIgnoredExtensions List of PHP extensions ignored during parsing data source

  • getIgnoredConstants List of constants (user or PHP internal) ignored during parsing data source

  • getSummary Returns only summary information when parsing a directory or multiple data sources

Answers to most Frequently Asked Questions (Previous) two solutions: auto and manual (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.