You are here

public function ComposerDeployHandler::__construct in Composer Deploy 8

Same name and namespace in other branches
  1. 7 includes/ComposerDeployHandler.php \Drupal\composer_deploy\ComposerDeployHandler::__construct()

File

src/ComposerDeployHandler.php, line 21
Contains \Drupal\composer_deploy\ComposerDeployHanlder.

Class

ComposerDeployHandler

Namespace

Drupal\composer_deploy

Code

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 : [];
}