PEAR logo

PHP_CompatInfo : The Definitive Guide



Chapter 7. CLI - The pcicmd console command

Table of Contents

Switchs
Overview
Reference

The PHP_CompatInfo_Cli class, also known under its wrapper name "pcicmd", get the compatibility info from PHP Command Line Interpreter, on existing script or folder.

Switchs

Overview

pcicmd [options]  -f FILE | -d DIR
     

Usage is to run pcicmd with at least the -f (--file) or -d (--dir) switch and perharps some additional and optional options.

Reference

-d | --dir

Identify the directory to parse to get compatibility info of its files contents.

-f | --file

Identify the file name (path) to parse to get compatibility info.

-n | --no-recurse

Do not recursively parse files into subdirectories when using --dir.

-v | --verbose

Set the verbose level. From 0 (no extra information) to 7 (full extra details).

In level 0, pcicmd give only results related to -d or -f. See first line of the console table. If there are more than one line, next ones are details for each file of a directory/branch.

+------------------------+---------+------------+------------------+
| Path                   | Version | Extensions | Constants/Tokens |
+------------------------+---------+------------+------------------+
| [...]\*                | 4.3.0   | bcmath     | __FILE__         |
|                        |         | pcre       |                  |
+------------------------+---------+------------+------------------+
| [...]\math.php         | 3.0.9   | bcmath     |                  |
|                        |         | pcre       |                  |
+------------------------+---------+------------+------------------+
| [...]\errorHandler.php | 4.3.0   |            |                  |
+------------------------+---------+------------+------------------+
         

In level 1, pcicmd give results of level 0 plus a resume of command line arguments. For example

pcicmd -v 1 -d \wamp\www\pci
         

give table of level 0 (see previous), plus :

Command Line resume :

+---------+---------------+
| Option  | Value         |
+---------+---------------+
| dir     | \wamp\www\pci |
| verbose | 1             |
+---------+---------------+
         

In level 2, pcicmd give results of level 0 plus the list of options PHP_CompatInfo used to parse file or directory. For example

pcicmd -d \wamp\www\pci -v 2
         

give table of level 0 (see previous), plus :

Parser options :

+--------+-------+
| Option | Value |
+--------+-------+
|        |       |
+--------+-------+
         
[Note] Note
Even when none option are used, the resume table is displayed.

In level 3, pcicmd give results of level 0, 1 and 2. For example

pcicmd -d \wamp\www\pci -n -v 3
         

give table of level 0 (see previous), plus :

Command Line resume :

+------------+---------------+
| Option     | Value         |
+------------+---------------+
| dir        | \wamp\www\pci |
| no-recurse | 1             |
| verbose    | 3             |
+------------+---------------+

Parser options :

+-------------+-------+
| Option      | Value |
+-------------+-------+
| recurse_dir | FALSE |
+-------------+-------+
         

In level 4, useless when using --dir, pcicmd give results of level 0 plus a list of functions implemented with their versions. For example

pcicmd -f \wamp\www\pci\math.php -v4
         

give :

+----------------+---------+------------+------------------+
| File           | Version | Extensions | Constants/Tokens |
+----------------+---------+------------+------------------+
| [...]\math.php | 3.0.9   | bcmath     |                  |
|                |         | pcre       |                  |
+----------------+---------+------------+------------------+

Debug:

+---------+------------+------------+
| Version | Function   | Extension  |
+---------+------------+------------+
| 3.0.9   | preg_match | ext_pcre   |
| 3.0.0   | bcsub      | ext_bcmath |
+---------+------------+------------+
         

Level 5 is equivalent to level 4 + level 1.

Level 6 is equivalent to level 4 + level 2.

And finally, level 7 is equivalent to level 4 + level 2 + level 1.

-if | --ignore-files

Identify the file name (path) to a text file that contains on each line the name of each file to ignore when parsing a directory/branch.

-id | --ignore-dirs

Identify the file name (path) to a text file that contains on each line the name of each sub-directory to ignore when parsing a directory/branch.

-in | --ignore-functions

Identify the file name (path) to a text file that contains on each line the name of each PHP function to ignore when parsing a directory or a single file.

-ic | --ignore-constants

Identify the file name (path) to a text file that contains on each line the name of each PHP constant to ignore when parsing a directory or a single file.

-ie | --ignore-extensions

Identify the file name (path) to a text file that contains on each line the name of each PHP extension to ignore (all extension.functions) when parsing a directory or a single file.

-iv | --ignore-versions

Expect one or two values that identify which PHP version (and all its related functions) to ignore.

[Tip] Tip
For example: ignore all PHP 5 functions (minor releases 0 thru 2), or only PHP 5.0.0 functions.
pcicmd -f FILE | -d DIR  -iv 5.0.0 5.2.0
pcicmd -f FILE | -d DIR  -iv 5.0.0
         
-h | --help

Show full help usage with all switchs explained.

PHP_CompatInfo : The Definitive Guide v 1.4.1 : February 12, 2007