Pop\Version

The popphp/pop-version component provides a simple API to test which version of Pop is installed, as well as evaluate the environment in which your application is running.

Installation

Install it directly into your project:

composer require popphp/pop-version

Or, include it in your composer.json file:

{
    "require": {
        "popphp/pop-version": "3.0.*",
    }
}

Basic Use

Check the version

// echo '3.0.0'
echo Pop\Version\Version::VERSION;

// echo '3.0.0'
echo Pop\Version\Version::getLatest();

// Returns true
if (Pop\Version\Version::isLatest()) { }

Evaluate the system environment

$env = Pop\Version\Version::systemCheck();

That will return an array will values like this:

Array
(
    [pop] => Array
        (
            [installed] => 3.0.0
            [latest] => 3.0.0
            [compare] => 0
        )

    [php] => Array
        (
            [installed] => 7.0.8
            [required] => 5.4.0
            [compare] => 1
        )

    [windows] =>
    [environment] => Array
        (
            [apc] => 1
            [archive] => Array
                (
                    [tar] =>
                    [zip] => 1
                    [bz2] => 1
                    [zlib] => 1
                )

            [curl] => 1
            [db] => Array
                (
                    [mysqli] => 1
                    [oracle] =>
                    [pdo] => Array
                        (
                            [mysql] => 1
                            [pgsql] => 1
                            [sqlite] => 1
                            [sqlsrv] =>
                        )

                    [pgsql] => 1
                    [sqlite] => 1
                    [sqlsrv] =>
                )

            [dom] => Array
                (
                    [dom_document] => 1
                    [simple_xml] => 1
                )

            [ftp] => 1
            [image] => Array
                (
                    [gd] => 1
                    [gmagick] =>
                    [imagick] => 1
                )

            [ldap] => 1
            [mcrypt] => 1
            [memcache] => 1
            [memcached] => 1
            [redis] => 1
            [soap] => 1
            [yaml] => 1
        )

)