1
0
Fork 0

PlatformRepository now adds packages for every loaded php extension as well

pull/1/head
Jordi Boggiano 2011-05-22 09:10:52 +02:00
parent 05d527446b
commit 56da52d38f
2 changed files with 9 additions and 1 deletions

View File

@ -32,6 +32,7 @@ class VersionConstraint extends SpecificConstraint
*/
public function __construct($operator, $version)
{
// TODO add third parameter releaseType and match that too
$this->operator = $operator;
$this->version = $version;
}

View File

@ -32,6 +32,13 @@ class PlatformRepository extends ArrayRepository
$php = new MemoryPackage('php', $version['version'], $version['type']);
$this->addPackage($php);
// TODO check for php extensions
foreach (get_loaded_extensions() as $ext) {
if (in_array($ext, array('standard', 'Core'))) {
continue;
}
// TODO maybe we could parse versions from phpinfo(INFO_MODULES)
$ext = new MemoryPackage('ext/'.strtolower($ext), '0', 'stable');
$this->addPackage($ext);
}
}
}