MediaWiki REL1_34
ComposerLock.php
Go to the documentation of this file.
1<?php
2
13 private $contents;
14
18 public function __construct( $location ) {
19 $this->contents = json_decode( file_get_contents( $location ), true );
20 }
21
27 public function getInstalledDependencies() {
28 $deps = [];
29 foreach ( $this->contents['packages'] as $installed ) {
30 $deps[$installed['name']] = [
31 'version' => ComposerJson::normalizeVersion( $installed['version'] ),
32 'type' => $installed['type'],
33 'licenses' => $installed['license'] ?? [],
34 'authors' => $installed['authors'] ?? [],
35 'description' => $installed['description'] ?? '',
36 ];
37 }
38
39 return $deps;
40 }
41}
static normalizeVersion( $version)
Strip a leading "v" from the version name.
Reads a composer.lock file and provides accessors to get its hash and what is installed.
__construct( $location)
getInstalledDependencies()
Dependencies currently installed according to composer.lock.
array[] $contents