Merge "DatabaseMssql: Don't duplicate body of makeList()"
[mediawiki.git] / includes / libs / composer / ComposerLock.php
blob9c7bf2f9ac2d28b5e6ae5bc21d02e076e747908f
1 <?php
3 /**
4 * Reads a composer.lock file and provides accessors to get
5 * its hash and what is installed
7 * @since 1.25
8 */
9 class ComposerLock {
11 /**
12 * @param string $location
14 public function __construct( $location ) {
15 $this->contents = json_decode( file_get_contents( $location ), true );
18 public function getHash() {
19 return $this->contents['hash'];
22 /**
23 * Dependencies currently installed according to composer.lock
25 * @return array
27 public function getInstalledDependencies() {
28 $deps = array();
29 foreach ( $this->contents['packages'] as $installed ) {
30 $deps[$installed['name']] = array(
31 'version' => ComposerJson::normalizeVersion( $installed['version'] ),
32 'type' => $installed['type'],
36 return $deps;