MediaWiki
REL1_34
ComposerLock.php
Go to the documentation of this file.
1
<?php
2
9
class
ComposerLock
{
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
}
ComposerJson\normalizeVersion
static normalizeVersion( $version)
Strip a leading "v" from the version name.
Definition
ComposerJson.php:46
ComposerLock
Reads a composer.lock file and provides accessors to get its hash and what is installed.
Definition
ComposerLock.php:9
ComposerLock\__construct
__construct( $location)
Definition
ComposerLock.php:18
ComposerLock\getInstalledDependencies
getInstalledDependencies()
Dependencies currently installed according to composer.lock.
Definition
ComposerLock.php:27
ComposerLock\$contents
array[] $contents
Definition
ComposerLock.php:13
includes
libs
composer
ComposerLock.php
Generated on Mon Nov 25 2024 16:05:16 for MediaWiki by
1.10.0