Download
We distribute a PHP Archive (PHAR) that contains all required dependencies of PHP CompatInfo bundled in a single file.
Make it executable, and put it into your $PATH
.
$ chmod +x phpcompatinfo-4.4.0.phar
$ mv phpcompatinfo-4.4.0.phar /usr/local/bin/phpcompatinfo
$ phpcompatinfo --version
You can also immediately use the PHAR after you have downloaded it.
$ wget http://bartlett.laurent-laville.org/get/phpcompatinfo-4.4.0.phar
$ php phpcompatinfo-4.4.0.phar --version
With both methods then you have this output :
phpCompatInfo version 4.4.0 DB built Jul 11 2015 09:22:57 CEST
Other alternative installations are possible. Please refer to the documentation for details on how to do this.
Configuration
phpcompatinfo.json
{
"source-providers": [
{
"in": ". as current",
"name": "/\\.(php|inc|phtml)$/"
}
],
"plugins": [
],
"analysers": [
],
"services": [
]
}
Put it in your project’s folder. Alternative locations are possible. Please refer to the documentation for details on how to do this.
Structure
- source-providers
- this entry provide list of your data sources to parse.
- plugins
- this entry list all plugins added to the core base code of PHP Reflect.
- analysers
-
this entry list all analysers that may be used with the
analyser:run
command. - services
- this entry list all services that may be used with this application.
Execution
With the CompatInfo source code, invoke the following command :
$ phpcompatinfo analyser:run .
and you should obtain something like this :
Data Source Analysed Directories 11 Files 13 Extensions Analysis Extension Matches REF EXT min/Max PHP min/Max PHP all Core Core 4.0.0 5.3.0 PDO PDO 5.1.0 5.1.0 curl curl 4.0.2 4.0.2 intl intl 2.0.0b1 5.3.7 libxml libxml 5.1.0 5.1.0 openssl openssl 5.2.0 5.2.0 pcre pcre 4.0.0 4.0.0 spl spl 5.1.0 5.1.0 standard standard 4.0.0 4.0.0 5.3.2 Total [9] 5.3.7 Namespaces Analysis Namespace Matches REF EXT min/Max PHP min/Max PHP all +global Core 4.0.0 Bartlett\CompatInfo user 5.3.0 Bartlett\CompatInfo\Analyser user 5.3.0 Bartlett\CompatInfo\Api user 5.3.0 5.3.2 Bartlett\CompatInfo\Api\V3 user 5.3.0 Bartlett\CompatInfo\Collection user 5.3.0 Bartlett\CompatInfo\Console user 5.3.0 Bartlett\CompatInfo\Console\Formatter user 5.3.0 Bartlett\CompatInfo\Output user 5.3.0 Bartlett\CompatInfo\PhpParser user 5.3.0 Bartlett\CompatInfo\Reference user 5.3.0 Bartlett\CompatInfo\Util user 5.3.0 Total [12] 5.3.0 5.3.2 Interfaces Analysis Interface Matches REF EXT min/Max PHP min/Max PHP all Bartlett\CompatInfo\Reference\ReferenceInterface 1 user 5.3.0 Total [1] 5.3.0 No trait found Classes Analysis Class Matches REF EXT min/Max PHP min/Max PHP all Bartlett\CompatInfo\Analyser\CompatibilityAnalyser user 5.3.0 Bartlett\CompatInfo\Api\Reference user 5.3.0 5.3.2 Bartlett\CompatInfo\Api\V3\Reference user 5.3.0 Bartlett\CompatInfo\Collection\ReferenceCollection 1 user 5.3.0 Bartlett\CompatInfo\Console\Application user 5.3.0 Bartlett\CompatInfo\Console\Formatter\CompatibilityOutputFormatter user 5.3.0 Bartlett\CompatInfo\Environment 4 user 5.3.0 Bartlett\CompatInfo\Output\Reference user 5.3.0 Bartlett\CompatInfo\PhpParser\ConditionalCodeNodeProcessor 1 user 5.3.0 Bartlett\CompatInfo\Reference\ExtensionFactory 2 user 5.3.0 Bartlett\CompatInfo\Reference\SqliteStorage 1 user 5.3.0 Bartlett\CompatInfo\Util\Version 10 user 5.3.0 U Bartlett\Reflect\Analyser\AbstractAnalyser 1 user 5.3.0 U Bartlett\Reflect\Api\BaseApi 1 user 5.3.0 U Bartlett\Reflect\Api\V3\Common 1 user 5.3.0 U Bartlett\Reflect\Console\Application 1 user 5.3.0 U Bartlett\Reflect\Console\Formatter\OutputFormatter 2 user 5.3.0 U Bartlett\Reflect\PhpParser\NodeProcessorAbstract 1 user 5.3.0 U Doctrine\Common\Collections\AbstractLazyCollection 1 user 5.3.0 U Doctrine\Common\Collections\ArrayCollection 1 user 5.3.0 PDO 2 PDO 5.1.0 5.1.0 U PhpParser\Node 21 user 5.3.0 U PhpParser\Node\Name 1 user 5.3.0 RuntimeException 1 spl 5.1.0 5.1.0 U Symfony\Component\Console\Helper\TableSeparator 3 user 5.3.0 U Symfony\Component\Console\Output\OutputInterface 4 user 5.3.0 parent 5 Core 5.0.0 5.0.0 self 11 Core 5.0.0 5.0.0 stdClass 1 Core 4.0.0 4.0.0 Total [29] 5.3.0 5.3.2 Functions Analysis Function Matches REF EXT min/Max PHP min/Max array_key_exists 7 standard 4.0.7 4.0.7 array_map 2 standard 4.0.6 4.0.6 array_merge 3 standard 4.0.0 4.0.0 array_pop 6 standard 4.0.0 4.0.0 array_shift 2 standard 4.0.0 4.0.0 array_slice 1 standard 4.0.0 4.0.0 array_values 1 standard 4.0.0 4.0.0 closure-73-75 user 5.3.0 copy 1 standard 4.0.0 4.0.0 count 14 standard 4.0.0 4.0.0 C curl_version 1 curl 4.0.2 4.0.2 defined 4 Core 4.0.0 4.0.0 dirname 3 standard 4.0.0 4.0.0 each 2 Core 4.0.0 4.0.0 end 3 standard 4.0.0 4.0.0 explode 2 standard 4.0.0 4.0.0 extension_loaded 1 Core 4.0.0 4.0.0 file_exists 2 standard 4.0.0 4.0.0 function_exists 1 Core 4.0.0 4.0.0 in_array 10 standard 4.0.0 4.0.0 is_array 1 standard 4.0.0 4.0.0 is_callable 1 standard 4.0.6 4.0.6 is_string 10 standard 4.0.0 4.0.0 ksort 3 standard 4.0.0 4.0.0 ltrim 1 standard 4.0.0 4.0.0 mkdir 1 standard 4.0.0 4.0.0 phpversion 2 standard 4.0.0 4.0.0 preg_match 2 pcre 4.0.0 4.0.0 sha1_file 2 standard 4.3.0 4.3.0 sprintf 26 standard 4.0.0 4.0.0 str_replace 1 standard 4.0.0 4.0.0 strcasecmp 4 Core 4.0.0 4.0.0 stream_resolve_include_path 1 standard 5.3.2 5.3.2 strpos 2 standard 4.0.0 4.0.0 strtolower 1 standard 4.0.0 4.0.0 substr 2 standard 4.0.0 4.0.0 sys_get_temp_dir 1 standard 5.2.1 5.2.1 ucfirst 5 standard 4.0.0 4.0.0 version_compare 9 standard 4.0.7 4.0.7 Total [39] 5.3.2 Constants Analysis Constant Matches REF EXT min/Max PHP min/Max C INTL_ICU_VERSION 2 intl 2.0.0b1 5.3.7 LIBXML_DOTTED_VERSION 1 libxml 5.1.0 5.1.0 LIBXML_VERSION 1 libxml 5.1.0 5.1.0 C OPENSSL_VERSION_NUMBER 1 openssl 5.2.0 5.2.0 C OPENSSL_VERSION_TEXT 1 openssl 5.2.0 5.2.0 PHP_EOL 5 Core 4.3.10 4.3.10 PHP_VERSION 4 Core 4.0.0 4.0.0 __DIR__ 1 Core 5.3.0 5.3.0 false 14 Core 4.0.0 4.0.0 null 15 Core 4.0.0 4.0.0 true 10 Core 4.0.0 4.0.0 Total [11] 5.3.0 Conditions Analysis Condition Matches REF EXT min/Max PHP min/Max defined(INTL_ICU_VERSION) 2 intl 2.0.0b1 5.3.7 defined(OPENSSL_VERSION_NUMBER) 1 openssl 5.2.0 5.2.0 defined(OPENSSL_VERSION_TEXT) 1 openssl 5.2.0 5.2.0 function_exists(curl_version) 1 curl 4.0.2 4.0.2 Total [4] 5.3.7 Requires PHP 5.3.2 (min), PHP 5.3.2 (all)
Summary
Let’s review what we’ve done :
-
downloaded the latest stable PHAR version.
-
prepared a minimalist JSON configuration file that is OPTIONAL to run CompatInfo commands.
-
executed your first parse on the CompatInfo data source.
Next
Choose your way depending of your skill level.