Compatibility analysis of PHP applications
+
Par Remi le vendredi 25 mars 2011, 18:00 - RPM - Lien permanent
During the development of a PHP application, or during its packaging, it could be usefull to check the PHP compatibility, the list of required extensions, etc.
The pci command, provided by the PHP_CompatInfo extension seems (to me) deprecated.
Laurent Laville, in his Bartlett channel, offers a new version 2 (2.0.0RC3 for now), fully rewritten, which seems promising.I try to collaborate with him, in particular to provide a extension's reference as complete as possible.
RPM are already available in the remi repository for fedora and enterprise linux (php-channel-bartlett, php-bartlett-PHP-Reflect and php-bartlett-PHP-Compatinfo) and should be submitted for review for official repository quickly.
For installation, as always:
yum --enablerepo=remi install php-bartlett-PHP-CompatInfo
The online documentation is in progress. You can also read the provided HOWTO.txt file.
A quick tour of this new tool:
$ phpci --version
phpci version 2.0.0RC3.
Analysis of requiered PHP version by an application
$ phpci print --recur /usr/share/phpMyAdmin
77 / 77 [+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] 100.00%
PHP COMPAT INFO REPORT SUMMARY
-------------------------------------------------------------------------------
FILES EXTENSIONS INTERFACES CLASSES FUNCTIONS CONSTANTS
-------------------------------------------------------------------------------
BASE: /usr/share/phpMyAdmin
-------------------------------------------------------------------------------
DIR.:
webapp.php 2 0 1 3 2
...
-------------------------------------------------------------------------------
A TOTAL OF
24 EXTENSION(S) 7 INTERFACE(S) 192 CLASSE(S) 903 FUNCTION(S) 259 CONSTANT(S)
WERE FOUND IN 490 FILE(S)
WITH CONDITIONAL CODE LEVEL 55
REQUIRED PHP 5.3.0 (MIN)
-------------------------------------------------------------------------------
Time: 0 seconds, Memory: 13.00Mb
-------------------------------------------------------------------------------
Analysis of extensions:
$ phpci print --report extension --recur /usr/share/phpMyAdmin
For this, I really need to find how to get only a sumnary report.
Liste of known extensions:
$ phpci list-extensions
-------------------------------------------------------------------------------
PHP COMPAT INFO EXTENSIONS REFERENCE
-------------------------------------------------------------------------------
EXTENSIONS EXTENSION VERSION
-------------------------------------------------------------------------------
Core 4.0.0
date 4.0.0
ereg 4.0.0 5.3.0
libxml 5.1.0
openssl 4.0.4
pcre 4.0.0
zlib 1.1 4.0.0
bz2 4.0.4
calendar 4.0.0
ctype 4.0.4
hash 1.0 5.1.2
filter 0.11.0 5.2.0
ftp 4.0.0
gettext 4.0.0
gmp 4.0.4
SPL 0.2 5.0.0
iconv 4.0.5
pcntl 4.1.0
session 4.0.0
standard 4.0.0
shmop 4.0.0
SimpleXML 0.1 5.0.0
sockets 4.1.0
tokenizer 0.1 4.2.0
xml 4.0.0
bcmath 4.0.0
curl 4.0.2
dom 20031129 5.0.0
enchant 1.1.0 5.3.0
fileinfo 1.0.5-dev 4.0.0
gd 4.0.0
imap 4.0.0
json 1.2.1 5.2.0
mbstring 4.0.6
mysql 1.0 4.0.0
mysqli 0.1 5.0.0
PDO 1.0.4dev 5.1.0
pgsql 4.0.0
SQLite 2.0-dev 5.0.0
wddx 4.0.0
xmlreader 0.1 5.0.0
xmlwriter 0.1 5.1.2
xsl 0.1 5.0.0
xdebug 2.1.0 5.2.0
-------------------------------------------------------------------------------
A TOTAL OF 44 EXTENSIONS WERE FOUND
-------------------------------------------------------------------------------
Time: 0 seconds, Memory: 9.00Mb
-------------------------------------------------------------------------------
This list should be improved before the final version.
So, I let you discover this useful tool, and I expect your feedback.
Commentaires
Packages submitted for review
New RPM :
RPM of finale versions (PHP_Reflect 1.0.0 and PHP_CompatInfo 2.0.0) are available in the repository.