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 "language: Move some language-related classes to includes/language/"
[lhc/web/wiklou.git]
/
maintenance
/
eval.php
diff --git
a/maintenance/eval.php
b/maintenance/eval.php
index
d98e5cd
..
f0d7fbf
100644
(file)
--- a/
maintenance/eval.php
+++ b/
maintenance/eval.php
@@
-30,6
+30,10
@@
* @ingroup Maintenance
*/
* @ingroup Maintenance
*/
+use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\Logger\ConsoleSpi;
+use MediaWiki\MediaWikiServices;
+
$optionsWithArgs = [ 'd' ];
require_once __DIR__ . "/commandLine.inc";
$optionsWithArgs = [ 'd' ];
require_once __DIR__ . "/commandLine.inc";
@@
-37,16
+41,13
@@
require_once __DIR__ . "/commandLine.inc";
if ( isset( $options['d'] ) ) {
$d = $options['d'];
if ( $d > 0 ) {
if ( isset( $options['d'] ) ) {
$d = $options['d'];
if ( $d > 0 ) {
- $wgDebugLogFile = '/dev/stdout';
+ 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 );
}
}
}
}
@@
-76,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 ) ) {