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