mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
PlatformRepository now adds packages for every loaded php extension as well
This commit is contained in:
parent
05d527446b
commit
56da52d38f
2 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue