class ComposerDeployHandler in Composer Deploy 7
Same name and namespace in other branches
- 8 src/ComposerDeployHandler.php \Drupal\composer_deploy\ComposerDeployHandler
Hierarchy
- class \Drupal\composer_deploy\ComposerDeployHandler
Expanded class hierarchy of ComposerDeployHandler
File
- includes/
ComposerDeployHandler.php, line 10 - Contains \Drupal\composer_deploy\ComposerDeployHandler.
Namespace
Drupal\composer_deployView source
class ComposerDeployHandler {
protected $packages = [];
public function __construct($path) {
$packages = json_decode(file_get_contents($path), TRUE);
// Composer 2.0 compatibility.
// @see https://getcomposer.org/upgrade/UPGRADE-2.0.md
$packages = $packages['packages'] ?? $packages;
$this->packages = is_array($packages) ? $packages : [];
}
public function getPackage($projectName) {
foreach ($this->packages as $package) {
if ($package['name'] == 'drupal/' . $projectName) {
return $package;
}
}
return FALSE;
}
public static function fromVendorDir($vendor_dir) {
return new static($vendor_dir . '/composer/installed.json');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ComposerDeployHandler:: |
protected | property | ||
ComposerDeployHandler:: |
public static | function | ||
ComposerDeployHandler:: |
public | function | ||
ComposerDeployHandler:: |
public | function |