A new command to validate json config file

The CompatInfo Command-Line Interface always needs a file in JSON format to run. It should be found either in the current, $HOME/.config/, or /etc directory.

By setting the COMPATINFO environment variable it is possible to set the filename of phpcompatinfo.json to something else.

E.g: COMPATINFO=my-phpcompatinfo.json

It’s very usefull to validate structure of the json configuration file before to run any command of CompatInfo

Example 1. Just run the command below
$ phpcompatinfo validate
Published by Laurent Laville on 2014-07-28

CompatInfo 3.2.0 has just been released.

  • Support new stable PHP versions 5.5.15 and 5.4.31

  • Support PHP 5.6.0RC2

  • Enhances a lot the documentation for all audiences

  • Add detection of class methods. See issue GH-100.

  • Improved stability by fixing most of regressions detected in 3.1

Published by Laurent Laville on 2014-07-24

Fixed issue GH-100 explained

The next stable version 3.2 of CompatInfo is now finished to be release as stable.

We will wait final version of PHP 5.5.15 and PHP 5.4.31 before to publish it.

It’s the moment to explain new major improvement in class method detection that was fixed today : See GH-100 report.

To solve the GH-100 issue, CompatInfo 3.2 will need the new Reflect 2.2 API.

See commits :

Summary Analysis will report something like:
Data Source Analysed

Directories                                          1
Files                                                1


Summary Analysis

Summary
  Extensions                                         1
  Namespaces                                         1
  Interfaces                                         0
  Traits                                             0
  Classes                                            1
  Methods                                            1
  Functions                                          0
  Constants                                          0
  Internal Functions                                 0

Versions
  PHP min                                        5.3.0
  PHP max
Notice that we count now in this analyser the Classes (DateTime) and Methods (diff) used, and not only user elements.
Classes Analysis will report something like:
 Class     REF EXT min/Max PHP min/Max
 DateTime      5.2.0       5.3.0
 Total [1]                 5.3.0
Version 5.3 is due to usage of DateTime::diff method.
Extensions Analysis will report something like:
 Extension REF EXT min/Max PHP min/Max
 date          5.2.0       5.3.0
 Total [1]                 5.3.0
Version 5.3 is due to usage of DateTime::diff method.
Namespaces Analysis will report something like:
 Namespace REF EXT min/Max PHP min/Max
 +global                   5.3.0
 Total [1]                 5.3.0
Version 5.3 is due to usage of DateTime::diff method.
Published by Laurent Laville on 2014-07-22

Latest preview before stable release

The next stable version 3.2 of CompatInfo is now ready to be release as stable.

We will wait final version of PHP 5.5.15 and PHP 5.4.31 before to publish it.

If you want to test this preview version, you can either :

Full documentation is now available at http://php5.laurent-laville.org/compatinfo/manual/3.2/en/

Published by Laurent Laville on 2014-07-18

Final touch before stable release planned next week

The next stable version 3.2 of CompatInfo is on way. We have reached today the last milestone, to enhance stability and fixed regression issues.

There are also some false-positive fixed from the 2.26

If you want to test the current test version, you can either :

Stable Release 3.2.0 is planned next week with a full Migration Guide (still missing from documentation)

Feedback are welcome !

Published by Laurent Laville on 2014-07-11

Analysers reports used the Symfony 2.5 Console Table Component

Data and render were separated on each analyser reports.

While in previous verson 3.x, I’ve introduced a forked
[https://github.com/llaville/php-compat-info/blob/v3/src/Bartlett/CompatInfo/ConsoleHelper.php]
of Symfony Console TableHelper (with footer support), today CompatInfo 3.2 will used the new Symfony 2.5 Console Table Helper.

As mentionned by Symfony Team, the Table Helper was deprecated in Symfony 2.5 and will be removed in Symfony 3.0.

We have two challenges to solve here :

  • introduces again the footer behavior

  • let each analyser choose to render results

For the first challenge, here are the code used to simulate a footer.

<?php

use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;

$table = new Table($output);
$table
    ->setHeaders(array('ISBN', 'Title', 'Author'))
    ->setRows(array(
        array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
        array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
        array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
        array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
        new TableSeparator(),
        array('<info>Footer col.1</info>','<info>Footer col.2</info>','<info>Footer col.3</info>'),
    ))
;
$table->render();

that will render something like :

default style
changes the default style to compact
<?php
    $table->setStyle('compact');

that will render something like :

compact style
changes the default style to borderless
<?php
    $table->setStyle('borderless');

that will render something like :

borderless style
Published by Laurent Laville on 2014-07-08

Release 3.2.0 planned

The third release of major branch 3 is planned for Monday July 14, 2014.

It will include a new full documentation for all audiences (basic users and developers).

A draft is already available for :

  • Getting Started section

  • User Guide

  • Developer Guide

And will come later :

  • Full details of API in developer guide

  • Migration Guide

Want to have a look, it’s here !

Published by Laurent Laville on 2014-07-01