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 "generatePhpCharToUpperMappings: Die if fopen fails"
[lhc/web/wiklou.git]
/
maintenance
/
eval.php
diff --git
a/maintenance/eval.php
b/maintenance/eval.php
index
ee8bdd6
..
f0d7fbf
100644
(file)
--- a/
maintenance/eval.php
+++ b/
maintenance/eval.php
@@
-32,6
+32,7
@@
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Logger\ConsoleSpi;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Logger\ConsoleSpi;
+use MediaWiki\MediaWikiServices;
$optionsWithArgs = [ 'd' ];
$optionsWithArgs = [ 'd' ];
@@
-41,15
+42,12
@@
if ( isset( $options['d'] ) ) {
$d = $options['d'];
if ( $d > 0 ) {
LoggerFactory::registerProvider( new ConsoleSpi );
$d = $options['d'];
if ( $d > 0 ) {
LoggerFactory::registerProvider( new ConsoleSpi );
+ // Some services hold Logger instances in object properties
+ MediaWikiServices::resetGlobalInstance();
}
if ( $d > 1 ) {
}
if ( $d > 1 ) {
- $lb = wfGetLB();
- $serverCount = $lb->getServerCount();
- for ( $i = 0; $i < $serverCount; $i++ ) {
- $server = $lb->getServerInfo( $i );
- $server['flags'] |= DBO_DEBUG;
- $lb->setServerInfo( $i, $server );
- }
+ wfGetDB( DB_MASTER )->setFlag( DBO_DEBUG );
+ wfGetDB( DB_REPLICA )->setFlag( DBO_DEBUG );
}
}
}
}
@@
-79,8
+77,8
@@
while ( ( $__line = Maintenance::readconsole() ) !== false ) {
try {
$__val = eval( $__line . ";" );
} catch ( Exception $__e ) {
try {
$__val = eval( $__line . ";" );
} catch ( Exception $__e ) {
-
echo
"Caught exception " . get_class( $__e ) .
- ": {$__e->getMessage()}\n" . $__e->getTraceAsString() . "\n";
+
fwrite( STDERR,
"Caught exception " . get_class( $__e ) .
+ ": {$__e->getMessage()}\n" . $__e->getTraceAsString() . "\n"
)
;
continue;
}
if ( wfIsHHVM() || is_null( $__val ) ) {
continue;
}
if ( wfIsHHVM() || is_null( $__val ) ) {