MediaWiki
master
ComposerInstalled.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\Composer
;
4
11
class
ComposerInstalled
{
15
private
$contents;
16
20
public
function
__construct
( $location ) {
21
$this->contents = json_decode( file_get_contents( $location ),
true
);
22
}
23
29
public
function
getInstalledDependencies
() {
30
$contents = $this->contents[
'packages'
];
31
32
$deps = [];
33
foreach
( $contents as $installed ) {
34
$deps[$installed[
'name'
]] = [
35
'version'
=>
ComposerJson::normalizeVersion
( $installed[
'version'
] ),
36
'type'
=> $installed[
'type'
],
37
'licenses'
=> $installed[
'license'
] ?? [],
38
'authors'
=> $installed[
'authors'
] ?? [],
39
'description'
=> $installed[
'description'
] ??
''
,
40
];
41
}
42
43
ksort( $deps );
44
return
$deps;
45
}
46
}
Wikimedia\Composer\ComposerInstalled
Reads an installed.json file and provides accessors to get what is installed.
Definition
ComposerInstalled.php:11
Wikimedia\Composer\ComposerInstalled\getInstalledDependencies
getInstalledDependencies()
Dependencies currently installed according to installed.json.
Definition
ComposerInstalled.php:29
Wikimedia\Composer\ComposerInstalled\__construct
__construct( $location)
Definition
ComposerInstalled.php:20
Wikimedia\Composer\ComposerJson\normalizeVersion
static normalizeVersion( $version)
Strip a leading "v" from the version name.
Definition
ComposerJson.php:50
Wikimedia\Composer
Definition
ComposerInstalled.php:3
includes
libs
composer
ComposerInstalled.php
Generated on Thu Sep 12 2024 22:23:56 for MediaWiki by
1.10.0