MediaWiki REL1_33
ComposerJson.php
Go to the documentation of this file.
1<?php
2
10
14 public function __construct( $location ) {
15 $this->contents = json_decode( file_get_contents( $location ), true );
16 }
17
23 public function getRequiredDependencies() {
24 $deps = [];
25 if ( isset( $this->contents['require'] ) ) {
26 foreach ( $this->contents['require'] as $package => $version ) {
27 if ( $package !== "php" && strpos( $package, 'ext-' ) !== 0 ) {
28 $deps[$package] = self::normalizeVersion( $version );
29 }
30 }
31 }
32
33 return $deps;
34 }
35
42 public static function normalizeVersion( $version ) {
43 if ( strpos( $version, 'v' ) === 0 ) {
44 // Composer auto-strips the "v" in front of the tag name
45 $version = ltrim( $version, 'v' );
46 }
47
48 return $version;
49 }
50
51}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Reads a composer.json file and provides accessors to get its hash and the required dependencies.
static normalizeVersion( $version)
Strip a leading "v" from the version name.
getRequiredDependencies()
Dependencies as specified by composer.json.
__construct( $location)
Some information about database access in MediaWiki By Tim January Database layout For information about the MediaWiki database such as a description of the tables and their contents
Definition database.txt:9