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 "SizeFilterWidget: Reduce width"
[lhc/web/wiklou.git]
/
maintenance
/
Maintenance.php
diff --git
a/maintenance/Maintenance.php
b/maintenance/Maintenance.php
index
7e4bf7c
..
4d0af5f
100644
(file)
--- a/
maintenance/Maintenance.php
+++ b/
maintenance/Maintenance.php
@@
-25,6
+25,7
@@
require_once __DIR__ . '/../includes/PHPVersionCheck.php';
wfEntryPointCheck( 'cli' );
require_once __DIR__ . '/../includes/PHPVersionCheck.php';
wfEntryPointCheck( 'cli' );
+use MediaWiki\Shell\Shell;
use Wikimedia\Rdbms\DBReplicationWaitError;
/**
use Wikimedia\Rdbms\DBReplicationWaitError;
/**
@@
-678,7
+679,7
@@
abstract class Maintenance {
* Do some sanity checking and basic setup
*/
public function setup() {
* Do some sanity checking and basic setup
*/
public function setup() {
- global $IP, $wgCommandLineMode
, $wgRequestTime
;
+ global $IP, $wgCommandLineMode;
# Abort if called from a web server
# wfIsCLI() is not available yet
# Abort if called from a web server
# wfIsCLI() is not available yet
@@
-715,8
+716,6
@@
abstract class Maintenance {
# But sometimes this doesn't seem to be the case.
ini_set( 'max_execution_time', 0 );
# But sometimes this doesn't seem to be the case.
ini_set( 'max_execution_time', 0 );
- $wgRequestTime = microtime( true );
-
# Define us as being in MediaWiki
define( 'MEDIAWIKI', true );
# Define us as being in MediaWiki
define( 'MEDIAWIKI', true );
@@
-1011,7
+1010,7
@@
abstract class Maintenance {
// ... append parameters ...
if ( $this->mParams ) {
// ... append parameters ...
if ( $this->mParams ) {
- $output .= " [--" . implode(
array_keys( $this->mParams ), "|--"
) . "]";
+ $output .= " [--" . implode(
"|--", array_keys( $this->mParams )
) . "]";
}
// ... and append arguments.
}
// ... and append arguments.
@@
-1294,7
+1293,7
@@
abstract class Maintenance {
* This function has the same parameters as wfGetDB()
*
* @param int $db DB index (DB_REPLICA/DB_MASTER)
* This function has the same parameters as wfGetDB()
*
* @param int $db DB index (DB_REPLICA/DB_MASTER)
- * @param
array
$groups default: empty array
+ * @param
string|string[]
$groups default: empty array
* @param string|bool $wiki default: current wiki
* @return IMaintainableDatabase
*/
* @param string|bool $wiki default: current wiki
* @return IMaintainableDatabase
*/
@@
-1594,12
+1593,12
@@
abstract class Maintenance {
// something that can do the relevant syscalls. There are a few
// options. Linux and Mac OS X both have "stty size" which does the
// job directly.
// something that can do the relevant syscalls. There are a few
// options. Linux and Mac OS X both have "stty size" which does the
// job directly.
- $re
tval = false;
-
$size = wfShellExec( 'stty size', $retval
);
- if ( $re
tval
!== 0 ) {
+ $re
sult = Shell::command( 'stty', 'size' )
+
->execute(
);
+ if ( $re
sult->getExitCode()
!== 0 ) {
return $default;
}
return $default;
}
- if ( !preg_match( '/^(\d+) (\d+)$/', $
size
, $m ) ) {
+ if ( !preg_match( '/^(\d+) (\d+)$/', $
result->getStdout()
, $m ) ) {
return $default;
}
return [ intval( $m[2] ), intval( $m[1] ) ];
return $default;
}
return [ intval( $m[2] ), intval( $m[1] ) ];