CompatInfo 4.0.0-beta-3 has just been released.

News :

  • Include 2 news commands from php-reflect 3.0.0-beta3 to draw UML diagrams. Learn more

  • The Migration Guide to v4 is now available.

Bugs :

  • fix missing output in CLI (Linux OS). Thanks to Remi Collet

Roadmap :
  • First release candidate is planned for Marth 4, 2015

  • Stable release one month later.

Download :

Published by Laurent Laville on 2015-02-27

CompatInfo 4.0.0-beta-2 has just been released.

News :

  • Ability to detect undeclared (classes / interfaces / traits) elements.

    See GH-165 report.

  • Database structure allow now to detect PHP extension evolutions like prototype methods. Example with DateTime methods transfered to DateTimeInterface since PHP 5.5.0

    See GH-164 report.

  • The Developer Guide is now available.

Bugs :

  • GH-166 : Type hinting and objects

Download :

Published by Laurent Laville on 2015-02-20

CompatInfo 4.0.0-beta-2 preview.

With recent changes and improvements, the second beta release for major version 4.0 is planned next week on Wednesday 18th.

News :

  • Ability to detect undeclared (classes / interfaces / traits) elements. Learn more on GH-165 report.

  • Database structure allow now to detect PHP extension evolutions like prototype methods. Example with DateTime methods transfered to DateTimeInterface since PHP 5.5.0; Learn more on GH-164 report.

Bugs :

  • GH-166 : Type hinting and objects

Published by Laurent Laville on 2015-02-12

CompatInfo 4.0.0-beta-1 has just been released.

4.0.0-beta1 is final milestone of API 4.0

We have reached a point where API is stabilized and is ready for a release candidate.

  • Like composer, CompatInfo has adopted an ascii text logo.

           _            ____                            _   ___        __
     _ __ | |__  _ __  / ___|___  _ __ ___  _ __   __ _| |_|_ _|_ __  / _| ___
    | '_ \| '_ \| '_ \| |   / _ \| '_ ` _ \| '_ \ / _` | __|| || '_ \| |_ / _ \
    | |_) | | | | |_) | |__| (_) | | | | | | |_) | (_| | |_ | || | | |  _| (_) |
    | .__/|_| |_| .__/ \____\___/|_| |_| |_| .__/ \__,_|\__|___|_| |_|_|  \___/
    |_|         |_|                        |_|
  • Database handle informations commands were optimized. Especially db:init (thanks to Remi Collet).

  • db:init do a backup first (db:backup) before to build a new fresh copy of the database (compatinfo.sqlite).

  • Add a new command db:release:php to easily tag end of life (php.max) some elements in references.

  • Add --major option to db:update command to read different version of json files.

  • Updates the Reflection reference to solve GH-162 issue.

  • DB version support new PHP 5.6.5, 5.5.21, 5.4.37 versions.

  • A new strategy to detect conditional code was applied. See GH-160 issue.

  • The current build version of the reference database is now printed with the CompatInfo version (see --version option).

  • Ability to test references corresponding to your platform. That will avoid tests failures if CompatInfo references are forward your platform and extensions supported.

    Impossible with CompatInfo 3.7.3, reason of commit 079bddf.
  • Specific code Collection\ReferenceCollection to this project have been transfered from php-reflect.

  • Added a new class CompatInfo\Util on code refactoring, to remove dupplicated code about version helper on building analyser’s reports.

  • A bit of color to make the phar manifest more readable.

  • Migrates reference:show command from API 3 to API 4

  • Updated php min version required (5.3.2) due to usage of stream_resolve_include_path with reference:show command and its filter option.

Download :

Published by Laurent Laville on 2015-02-04

CompatInfo 4.0.0-beta-1 preview.

While 4.0.0-beta1 was initially planned on 2015-01-30 (see roadmap), it’s now ready to be released on Februrary 4th 2015.

Highlight the main feature that will be available in the new API 4.0 :

  • A unified API for all platforms and usages.
    Command-Line Interface or via PHP code with the same pattern.

With Symfony Console verbosity level 3, you will print the raw API response rather than the console view report. Easy to debug and compare.

  • Example 1: Compare analyser run process (with a single analyser)

CLI
$ php bin\phpcompatinfo -vvv analyser:run ../src
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\Reflect\Api\Analyser
$api = $client->api('analyser');

// perform request, on a data source with default analyser
$dataSource = dirname(__DIR__) . '/src';
$analysers  = array('compatibility');

$metrics = $api->run($dataSource, $analysers);

print_r($metrics);

  • Example 2: Compare analyser list process

CLI
$ php bin\phpcompatinfo -vvv analyser:list
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\CompatInfo\Api\Analyser
$api = $client->api('analyser');

$analysers = $api->dir();

print_r($analysers);

  • Example 3: Compare reference list process

CLI
$ php bin\phpcompatinfo -vvv reference:list
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\CompatInfo\Api\Reference
$api = $client->api('reference');

$refs = $api->dir();

print_r($refs);

  • Example 4: Compare reference show process (with full details)

CLI
$ php bin\phpcompatinfo -vvv reference:show amqp
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\CompatInfo\Api\Reference
$api = $client->api('reference');

$ref = $api->show('amqp');

print_r($ref);

  • Example 5: Compare reference show process (with closure to filter results)

CLI
$ php bin\phpcompatinfo -vvv reference:show amqp --classes --filter=YourFilters.php

With (for example) a YourFilters.php file contents as follow (anywhere in your include_path)

<?php
// returns all classes of extension that have release 1.0.0 or greater
$closure = function ($data) {
    foreach ($data as $title => &$values) {
        foreach ($values as $key => $val) {
            switch ($title) {
                case 'classes':
                    if (version_compare($val['ext.min'], '1.0.0', 'lt')) {
                        unset($values[$key]);
                    }
                    break;
            }
        }
    }
    return $data;
};
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\CompatInfo\Api\Reference
$api = $client->api('reference');

include_once 'YourFilters.php';

$ref = $api->show('amqp', $closure, false, false, false, false, false, true);

print_r($ref);

  • Example 6: Compare reflection class process (inherit from php-reflect)

CLI
$ php bin\phpcompatinfo reflection:class Bartlett\Reflect ../src
Do not use verbose level 3 to compare results in this case. It will return a Bartlett\Reflect\Model\ClassModel instance.
PHP
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

use Bartlett\Reflect\Client;

// creates an instance of client
$client = new Client();

// request for a Bartlett\Reflect\Api\Reflection
$api = $client->api('reflection');

// perform request, on a data source
$dataSource = dirname(__DIR__) . '/src';

$model = $api->class_('Bartlett\\Reflect', $dataSource);

echo $model;

CLI or PHP mode will print such output

Class [ <user> class Bartlett\Reflect extends Bartlett\Reflect\Event\AbstractDispatcher ] {
  @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 45 - 340

  - Constants [0] {
  }

  - Properties [2] {
    Property [ private $analysers ]
    Property [ private $dataSourceId ]
  }

  - Methods [6] {
    Method [ <user> public method __construct ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 53 - 57

      - Parameters [0] {
      }
    }

    Method [ <user> public method addAnalyser ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 66 - 71

      - Parameters [1] {
        Parameter #0 [ <required> PhpParser\NodeVisitor $analyser ]
      }
    }

    Method [ <user> public method getAnalysers ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 78 - 81

      - Parameters [0] {
      }
    }

    Method [ <user> public method setDataSourceId ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 90 - 94

      - Parameters [1] {
        Parameter #0 [ <required> $id ]
      }
    }

    Method [ <user> public method getDataSourceId ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 101 - 104

      - Parameters [0] {
      }
    }

    Method [ <user> public method parse ] {
      @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 113 - 339

      - Parameters [1] {
        Parameter #0 [ <required> Symfony\Component\Finder\Finder $finder ]
      }
    }
  }
}
Published by Laurent Laville on 2015-02-02