MediaWiki REL1_34
ComposerInstalled.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 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 ksort( $deps );
40 return $deps;
41 }
42}
Reads an installed.json file and provides accessors to get what is installed.
getInstalledDependencies()
Dependencies currently installed according to installed.json.
static normalizeVersion( $version)
Strip a leading "v" from the version name.