protected function CakePHPInstaller::matchesCakeVersion in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php \Composer\Installers\CakePHPInstaller::matchesCakeVersion()
Check if CakePHP version matches against a version
Parameters
string $matcher:
string $version:
Return value
bool
2 calls to CakePHPInstaller::matchesCakeVersion()
- CakePHPInstaller::getLocations in vendor/
composer/ installers/ src/ Composer/ Installers/ CakePHPInstaller.php - Change the default plugin location when cakephp >= 3.0
- CakePHPInstaller::inflectPackageVars in vendor/
composer/ installers/ src/ Composer/ Installers/ CakePHPInstaller.php - Format package name to CamelCase
File
- vendor/
composer/ installers/ src/ Composer/ Installers/ CakePHPInstaller.php, line 53
Class
Namespace
Composer\InstallersCode
protected function matchesCakeVersion($matcher, $version) {
$repositoryManager = $this->composer
->getRepositoryManager();
if ($repositoryManager) {
$repos = $repositoryManager
->getLocalRepository();
if (!$repos) {
return false;
}
$cake3 = new MultiConstraint(array(
new VersionConstraint($matcher, $version),
new VersionConstraint('!=', '9999999-dev'),
));
$pool = new Pool('dev');
$pool
->addRepository($repos);
$packages = $pool
->whatProvides('cakephp/cakephp');
foreach ($packages as $package) {
$installed = new VersionConstraint('=', $package
->getVersion());
if ($cake3
->matches($installed)) {
return true;
break;
}
}
}
return false;
}