omatech/vendor-version

检查composer安装并获取vendor文件夹中已安装包的信息

dev-master 2019-11-17 10:52 UTC

This package is auto-updated.

Last update: 2024-09-17 22:23:19 UTC


README

$vv = new VendorVersion();
$vv->init(YOUR_PROJECT_ROOT_FOLDER);
$res=$vv->isInstalled('phpunit/phpunit');
// returns true or false

if ($res)
{
    $version_res=$vv->checkMinVersion('phpunit/phpunit', '8.0');
    // returns true if at least you have version 8.0 installed
    $version=$vv->getVersion('phpunit/phpunit');
    // now $version have the exact phpunit/phpunit installed
}

测试

phpunit --bootstrap vendor/autoload.php tests