dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "updateCollation.php: Improve --dry-run mode"
[lhc/web/wiklou.git]
/
maintenance
/
checkComposerLockUpToDate.php
diff --git
a/maintenance/checkComposerLockUpToDate.php
b/maintenance/checkComposerLockUpToDate.php
index
7a85d64
..
69f16f5
100644
(file)
--- a/
maintenance/checkComposerLockUpToDate.php
+++ b/
maintenance/checkComposerLockUpToDate.php
@@
-12,8
+12,8
@@
require_once __DIR__ . '/Maintenance.php';
class CheckComposerLockUpToDate extends Maintenance {
public function __construct() {
parent::__construct();
class CheckComposerLockUpToDate extends Maintenance {
public function __construct() {
parent::__construct();
- $this->
mDescription =
- 'Checks whether your composer.lock file is up to date with the current composer.json';
+ $this->
addDescription(
+ 'Checks whether your composer.lock file is up to date with the current composer.json'
)
;
}
public function execute() {
}
public function execute() {
@@
-24,9
+24,8
@@
class CheckComposerLockUpToDate extends Maintenance {
// Maybe they're using mediawiki/vendor?
$lockLocation = "$IP/vendor/composer.lock";
if ( !file_exists( $lockLocation ) ) {
// Maybe they're using mediawiki/vendor?
$lockLocation = "$IP/vendor/composer.lock";
if ( !file_exists( $lockLocation ) ) {
- $this->error(
- 'Could not find composer.lock file. Have you run "composer install"?',
- 1
+ $this->fatalError(
+ 'Could not find composer.lock file. Have you run "composer install --no-dev"?'
);
}
}
);
}
}
@@
-34,11
+33,7
@@
class CheckComposerLockUpToDate extends Maintenance {
$lock = new ComposerLock( $lockLocation );
$json = new ComposerJson( $jsonLocation );
$lock = new ComposerLock( $lockLocation );
$json = new ComposerJson( $jsonLocation );
- if ( $lock->getHash() === $json->getHash() ) {
- $this->output( "Your composer.lock file is up to date with current dependencies!\n" );
- return;
- }
- // Out of date, lets figure out which dependencies are old
+ // Check all the dependencies to see if any are old
$found = false;
$installed = $lock->getInstalledDependencies();
foreach ( $json->getRequiredDependencies() as $name => $version ) {
$found = false;
$installed = $lock->getInstalledDependencies();
foreach ( $json->getRequiredDependencies() as $name => $version ) {
@@
-55,20
+50,16
@@
class CheckComposerLockUpToDate extends Maintenance {
}
}
if ( $found ) {
}
}
if ( $found ) {
- $this->
e
rror(
+ $this->
fatalE
rror(
'Error: your composer.lock file is not up to date. ' .
'Error: your composer.lock file is not up to date. ' .
- 'Run "composer update" to install newer dependencies',
- 1
+ 'Run "composer update --no-dev" to install newer dependencies'
);
} else {
);
} else {
- // The hash is the entire composer.json file,
- // so it can be updated without any of the dependencies changing
// We couldn't find any out-of-date dependencies, so assume everything is ok!
$this->output( "Your composer.lock file is up to date with current dependencies!\n" );
}
// We couldn't find any out-of-date dependencies, so assume everything is ok!
$this->output( "Your composer.lock file is up to date with current dependencies!\n" );
}
-
}
}
}
}
-$maintClass =
'CheckComposerLockUpToDate'
;
+$maintClass =
CheckComposerLockUpToDate::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;