X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2Flibs%2Fcomposer%2FComposerJson.php;h=62231a89b61079370b83d055960cbd6d2fec6014;hb=75fefc066b892ef24aa99a2780fbbe21ba7a84da;hp=796acb56c718f80cda22c15b85fca26b81fe9b69;hpb=8b1a78fa5e62923d6dea1f9fe578c46b2910155e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/composer/ComposerJson.php b/includes/libs/composer/ComposerJson.php index 796acb56c7..62231a89b6 100644 --- a/includes/libs/composer/ComposerJson.php +++ b/includes/libs/composer/ComposerJson.php @@ -12,24 +12,21 @@ class ComposerJson { * @param string $location */ public function __construct( $location ) { - $this->hash = md5_file( $location ); $this->contents = json_decode( file_get_contents( $location ), true ); } - public function getHash() { - return $this->hash; - } - /** * Dependencies as specified by composer.json * * @return array */ public function getRequiredDependencies() { - $deps = array(); - foreach ( $this->contents['require'] as $package => $version ) { - if ( $package !== "php" && strpos( $package, 'ext-' ) !== 0 ) { - $deps[$package] = self::normalizeVersion( $version ); + $deps = []; + if ( isset( $this->contents['require'] ) ) { + foreach ( $this->contents['require'] as $package => $version ) { + if ( $package !== "php" && strpos( $package, 'ext-' ) !== 0 ) { + $deps[$package] = self::normalizeVersion( $version ); + } } }