MediaWiki
REL1_37
ComposerLock.php
Go to the documentation of this file.
1
<?php
2
9
class
ComposerLock
{
14
private
$contents
;
15
19
public
function
__construct
( $location ) {
20
$this->contents = json_decode( file_get_contents( $location ),
true
);
21
}
22
28
public
function
getInstalledDependencies
() {
29
$deps = [];
30
foreach
( $this->contents[
'packages'
] as $installed ) {
31
$deps[$installed[
'name'
]] = [
32
'version'
=>
ComposerJson::normalizeVersion
( $installed[
'version'
] ),
33
'type'
=> $installed[
'type'
],
34
'licenses'
=> $installed[
'license'
] ?? [],
35
'authors'
=> $installed[
'authors'
] ?? [],
36
'description'
=> $installed[
'description'
] ??
''
,
37
];
38
}
39
40
return
$deps;
41
}
42
}
ComposerJson\normalizeVersion
static normalizeVersion( $version)
Strip a leading "v" from the version name.
Definition
ComposerJson.php:48
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:19
ComposerLock\getInstalledDependencies
getInstalledDependencies()
Dependencies currently installed according to composer.lock.
Definition
ComposerLock.php:28
ComposerLock\$contents
array[] $contents
Definition
ComposerLock.php:14
includes
libs
composer
ComposerLock.php
Generated on Fri Apr 5 2024 23:40:26 for MediaWiki by
1.9.8