Movatterモバイル変換


[0]ホーム

URL:


MediaWiki master
MWExceptionHandler.php
Go to the documentation of this file.
1<?php
7namespaceMediaWiki\Exception;
8
9use ErrorException;
10useMediaWiki\Debug\MWDebug;
11useMediaWiki\HookContainer\HookRunner;
12useMediaWiki\Logger\LoggerFactory;
13useMediaWiki\MediaWikiServices;
14useMediaWiki\Request\WebRequest;
15use Psr\Log\LogLevel;
16use Throwable;
17use Wikimedia\NormalizedException\INormalizedException;
18useWikimedia\Rdbms\DBError;
19useWikimedia\Rdbms\DBQueryError;
20useWikimedia\Rdbms\LBFactory;
21use Wikimedia\Services\RecursiveServiceDependencyException;
22
27classMWExceptionHandler {
29publicconstCAUGHT_BY_HANDLER ='mwe_handler';
31publicconstCAUGHT_BY_ENTRYPOINT ='entrypoint';
33publicconstCAUGHT_BY_OTHER ='other';
34
36protectedstatic$reservedMemory;
37
46privateconst FATAL_ERROR_TYPES = [
47 E_ERROR,
48 E_PARSE,
49 E_CORE_ERROR,
50 E_COMPILE_ERROR,
51 E_USER_ERROR,
52
53// E.g. "Catchable fatal error: Argument X must be Y, null given"
54 E_RECOVERABLE_ERROR,
55 ];
56
62privatestatic $logExceptionBacktrace =true;
63
69privatestatic $propagateErrors;
70
78publicstaticfunctioninstallHandler(
79bool $logExceptionBacktrace =true,
80bool $propagateErrors =true
81 ) {
82 self::$logExceptionBacktrace = $logExceptionBacktrace;
83 self::$propagateErrors = $propagateErrors;
84
85// This catches:
86// * Exception objects that were explicitly thrown but not
87// caught anywhere in the application. This is rare given those
88// would normally be caught at a high-level like MediaWiki::run (index.php),
89// api.php, or ResourceLoader::respond (load.php). These high-level
90// catch clauses would then call MWExceptionHandler::logException
91// or MWExceptionHandler::handleException.
92// If they are not caught, then they are handled here.
93// * Error objects for issues that would historically
94// cause fatal errors but may now be caught as Throwable (not Exception).
95// Same as previous case, but more common to bubble to here instead of
96// caught locally because they tend to not be safe to recover from.
97// (e.g. argument TypeError, division by zero, etc.)
98 set_exception_handler( self::handleUncaughtException( ... ) );
99
100// This catches recoverable errors (e.g. PHP Notice, PHP Warning, PHP Error) that do not
101// interrupt execution in any way. We log these in the background and then continue execution.
102 set_error_handler( self::handleError( ... ) );
103
104// This catches fatal errors for which no Throwable is thrown,
105// including Out-Of-Memory and Timeout fatals.
106// Reserve 16k of memory so we can report OOM fatals.
107 self::$reservedMemory = str_repeat(' ', 16384 );
108 register_shutdown_function( self::handleFatalError( ... ) );
109 }
110
114protectedstaticfunctionreport( Throwable $e ) {
115try {
116// Try and show the exception prettily, with the normal skin infrastructure
117if ( $e instanceofMWException && $e->hasOverriddenHandler() ) {
118// Delegate to MWException until all subclasses are handled by
119// MWExceptionRenderer and MWException::report() has been
120// removed.
121 $e->report();
122 }else {
124 }
125 }catch ( Throwable $e2 ) {
126// Exception occurred from within exception handler
127// Show a simpler message for the original exception,
128// don't try to invoke report()
130 }
131 }
132
138privatestaticfunction rollbackPrimaryChanges() {
139if ( !MediaWikiServices::hasInstance() ) {
140// MediaWiki isn't fully initialized yet, it's not safe to access services.
141// This also means that there's nothing to roll back yet.
142return;
143 }
144
145 $services =MediaWikiServices::getInstance();
146 $lbFactory = $services->peekService('DBLoadBalancerFactory' );
147'@phan-var LBFactory $lbFactory';/* @var LBFactory $lbFactory */
148if ( !$lbFactory ) {
149// There's no need to roll back transactions if the LBFactory is
150// disabled or hasn't been created yet
151return;
152 }
153
154// Roll back DBs to avoid transaction notices. This might fail
155// to roll back some databases due to connection issues or exceptions.
156// However, any sensible DB driver will roll back implicitly anyway.
157try {
158 $lbFactory->rollbackPrimaryChanges( __METHOD__ );
159 $lbFactory->flushPrimarySessions( __METHOD__ );
160 }catch ( DBError $e ) {
161// If the DB is unreachable, rollback() will throw an error
162// and the error report() method might need messages from the DB,
163// which would result in an exception loop. PHP may escalate such
164// errors to "Exception thrown without a stack frame" fatals, but
165// it's better to be explicit here.
166self::logException( $e, self::CAUGHT_BY_HANDLER );
167 }
168 }
169
180 Throwable $e,
181 $catcher = self::CAUGHT_BY_OTHER
182 ) {
183 self::rollbackPrimaryChanges();
184
185self::logException( $e, $catcher );
186 }
187
194publicstaticfunctionhandleUncaughtException( Throwable $e ) {
195self::handleException( $e, self::CAUGHT_BY_HANDLER );
196
197// Make sure we don't claim success on exit for CLI scripts (T177414)
198if (wfIsCLI() ) {
199 register_shutdown_function(
200staticfunction (): never {
201 exit( 255 );
202 }
203 );
204 }
205 }
206
222publicstaticfunctionhandleException( Throwable $e, $catcher = self::CAUGHT_BY_OTHER ) {
224self::report( $e );
225 }
226
241publicstaticfunctionhandleError(
242 $level,
243 $message,
244 $file =null,
245 $line =null
246 ) {
247// E_STRICT is deprecated since PHP 8.4 (T375707).
248// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
249if ( defined('E_STRICT' ) && $level == @constant('E_STRICT' ) ) {
250 $level = E_USER_NOTICE;
251 }
252
253// Map PHP error constant to a PSR-3 severity level.
254// Avoid use of "DEBUG" or "INFO" levels, unless the
255// error should evade error monitoring and alerts.
256//
257// To decide the log level, ask yourself: "Has the
258// program's behaviour diverged from what the written
259// code expected?"
260//
261// For example, use of a deprecated method or violating a strict standard
262// has no impact on functional behaviour (Warning). On the other hand,
263// accessing an undefined variable makes behaviour diverge from what the
264// author intended/expected. PHP recovers from an undefined variables by
265// yielding null and continuing execution, but it remains a change in
266// behaviour given the null was not part of the code and is likely not
267// accounted for.
268switch ( $level ) {
269case E_WARNING:
270case E_CORE_WARNING:
271case E_COMPILE_WARNING:
272 $prefix ='PHP Warning: ';
273 $severity = LogLevel::ERROR;
274break;
275case E_NOTICE:
276 $prefix ='PHP Notice: ';
277 $severity = LogLevel::ERROR;
278break;
279case E_USER_NOTICE:
280// Used by wfWarn(), MWDebug::warning()
281 $prefix ='PHP Notice: ';
282 $severity = LogLevel::WARNING;
283break;
284case E_USER_WARNING:
285// Used by wfWarn(), MWDebug::warning()
286 $prefix ='PHP Warning: ';
287 $severity = LogLevel::WARNING;
288break;
289case E_DEPRECATED:
290 $prefix ='PHP Deprecated: ';
291 $severity = LogLevel::WARNING;
292break;
293case E_USER_DEPRECATED:
294 $prefix ='PHP Deprecated: ';
295 $severity = LogLevel::WARNING;
296 $real = MWDebug::parseCallerDescription( $message );
297if ( $real ) {
298// Used by wfDeprecated(), MWDebug::deprecated()
299// Apply caller offset from wfDeprecated() to the native error.
300// This makes errors easier to aggregate and find in e.g. Kibana.
301 $file = $real['file'];
302 $line = $real['line'];
303 $message = $real['message'];
304 }
305break;
306default:
307 $prefix ='PHP Unknown error: ';
308 $severity = LogLevel::ERROR;
309break;
310 }
311
312// @phan-suppress-next-line PhanTypeMismatchArgumentNullableInternal False positive
313 $e =new ErrorException( $prefix . $message, 0, $level, $file, $line );
314 self::logError( $e, $severity, self::CAUGHT_BY_HANDLER );
315
316// If $propagateErrors is true return false so PHP shows/logs the error normally.
317return !self::$propagateErrors;
318 }
319
333publicstaticfunctionhandleFatalError(): void {
334// Free reserved memory so that we have space to process OOM
335// errors
336 self::$reservedMemory = null;
337
338 $lastError = error_get_last();
339if ( $lastError ===null ) {
340return;
341 }
342
343 $level = $lastError['type'];
344 $message = $lastError['message'];
345 $file = $lastError['file'];
346 $line = $lastError['line'];
347
348if ( !in_array( $level, self::FATAL_ERROR_TYPES ) ) {
349// Only interested in fatal errors, others should have been
350// handled by MWExceptionHandler::handleError
351return;
352 }
353
354 $msgParts = [
355'[{reqId}] {exception_url} PHP Fatal Error',
356 ( $line || $file ) ?' from' :'',
357 $line ?" line $line" :'',
358 ( $line && $file ) ?' of' :'',
359 $file ?" $file" :'',
360": $message",
361 ];
362 $msg = implode('', $msgParts );
363
364// Look at message to see if this is a class not found failure (Class 'foo' not found)
365if ( preg_match("/Class '\w+' not found/", $message ) ) {
366// phpcs:disable Generic.Files.LineLength
367 $msg = <<<TXT
368{$msg}
369
370MediaWiki or an installed extensionrequiresthisclassbut it is not embedded directly inMediaWiki's git repository and must be installed separately by the end user.
371
372Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>for help on installing the required components.
373TXT;
374// phpcs:enable
375 }
376
377 $e =new ErrorException("PHP Fatal Error: {$message}", 0, $level, $file, $line );
378$logger = LoggerFactory::getInstance('exception' );
379$logger->error( $msg, self::getLogContext( $e, self::CAUGHT_BY_HANDLER ) );
380 }
381
392publicstaticfunctiongetRedactedTraceAsString( Throwable $e ) {
393 $from ='from ' . $e->getFile() .'(' . $e->getLine() .')' ."\n";
394return $from . self::prettyPrintTrace( self::getRedactedTrace( $e ) );
395 }
396
405publicstaticfunctionprettyPrintTrace( array $trace, $pad ='' ) {
406 $text ='';
407
408 $level = 0;
409foreach ( $trace as $level => $frame ) {
410if ( isset( $frame['file'] ) && isset( $frame['line'] ) ) {
411 $text .="{$pad}#{$level} {$frame['file']}({$frame['line']}): ";
412 }else {
413// 'file' and 'line' are unset for calls from C code
414// (T57634) This matches behaviour of
415// Throwable::getTraceAsString to instead display "[internal
416// function]".
417 $text .="{$pad}#{$level} [internal function]: ";
418 }
419
420if ( isset( $frame['class'] ) && isset( $frame['type'] ) && isset( $frame['function'] ) ) {
421 $text .= $frame['class'] . $frame['type'] . $frame['function'];
422 }else {
423 $text .= $frame['function'] ??'NO_FUNCTION_GIVEN';
424 }
425
426if ( isset( $frame['args'] ) ) {
427 $text .='(' . implode(', ', $frame['args'] ) .")\n";
428 }else {
429 $text .="()\n";
430 }
431 }
432
433 $level++;
434 $text .="{$pad}#{$level} {main}";
435
436return $text;
437 }
438
450publicstaticfunctiongetRedactedTrace( Throwable $e ) {
451return static::redactTrace( $e->getTrace() );
452 }
453
464publicstaticfunctionredactTrace( array $trace ) {
465return array_map(staticfunction ( $frame ) {
466if ( isset( $frame['args'] ) ) {
467 $frame['args'] = array_map('get_debug_type', $frame['args'] );
468 }
469return $frame;
470 }, $trace );
471 }
472
480publicstaticfunctiongetURL() {
481if (MW_ENTRY_POINT ==='cli' ) {
482returnfalse;
483 }
484return WebRequest::getGlobalRequestURL();
485 }
486
497publicstaticfunctiongetLogMessage( Throwable $e ) {
498 $id = WebRequest::getRequestId();
499 $type = get_class( $e );
500 $message = $e->getMessage();
501$url = self::getURL() ?:'[no req]';
502
503if ( $e instanceofDBQueryError ) {
504 $message ="A database query error has occurred. Did you forget to run"
505 ." your application's database schema updater after upgrading"
506 ." or after adding a new extension?\n\nPlease see"
507 ." https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and"
508 ." https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug"
509 ." for more information.\n\n"
510 . $message;
511 }
512
513return"[$id] $url $type: $message";
514 }
515
525publicstaticfunctiongetLogNormalMessage( Throwable $e ) {
526if ( $e instanceof INormalizedException ) {
527 $message = $e->getNormalizedMessage();
528 }else {
529 $message = $e->getMessage();
530 }
531if ( !$e instanceof ErrorException ) {
532// ErrorException is something we use internally to represent
533// PHP errors (runtime warnings that aren't thrown or caught),
534// don't bother putting it in the logs. Let the log message
535// lead with "PHP Warning: " instead (see ::handleError).
536 $message = get_class( $e ) .": $message";
537 }
538
539return"[{reqId}] {exception_url} $message";
540 }
541
546publicstaticfunctiongetPublicLogMessage( Throwable $e ) {
547 $reqId = WebRequest::getRequestId();
548 $type = get_class( $e );
549return'[' . $reqId .'] '
550 . gmdate('Y-m-d H:i:s' ) .': '
551 .'Fatal exception of type "' . $type .'"';
552 }
553
566publicstaticfunctiongetLogContext( Throwable $e, $catcher = self::CAUGHT_BY_OTHER ) {
567 $context = [
568'exception' => $e,
569'exception_url' => self::getURL() ?:'[no req]',
570// The reqId context key use the same familiar name and value as the top-level field
571// provided by LogstashFormatter. However, formatters are configurable at run-time,
572// and their top-level fields are logically separate from context keys and cannot be,
573// substituted in a message, hence set explicitly here. For WMF users, these may feel,
574// like the same thing due to Monolog V0 handling, which transmits "fields" and "context",
575// in the same JSON object (after message formatting).
576'reqId' => WebRequest::getRequestId(),
577'caught_by' => $catcher
578 ];
579if ( $e instanceof INormalizedException ) {
580 $context += $e->getMessageContext();
581 }
582return $context;
583 }
584
597publicstaticfunctiongetStructuredExceptionData(
598 Throwable $e,
599 $catcher = self::CAUGHT_BY_OTHER
600 ) {
601 $data = [
602'id' => WebRequest::getRequestId(),
603'type' => get_class( $e ),
604'file' => $e->getFile(),
605'line' => $e->getLine(),
606'message' => $e->getMessage(),
607'code' => $e->getCode(),
608'url' => self::getURL() ?:null,
609'caught_by' => $catcher
610 ];
611
612if ( $e instanceof ErrorException &&
613 ( error_reporting() & $e->getSeverity() ) === 0
614 ) {
615// Flag suppressed errors
616 $data['suppressed'] =true;
617 }
618
619if ( self::$logExceptionBacktrace ) {
620 $data['backtrace'] = self::getRedactedTrace( $e );
621 }
622
623 $previous = $e->getPrevious();
624if ( $previous !==null ) {
625 $data['previous'] = self::getStructuredExceptionData( $previous, $catcher );
626 }
627
628return $data;
629 }
630
642publicstaticfunctionlogException(
643 Throwable $e,
644 $catcher = self::CAUGHT_BY_OTHER,
645 $extraData = []
646 ) {
647if ( !( $e instanceofMWException ) || $e->isLoggable() ) {
648 $logger = LoggerFactory::getInstance('exception' );
649 $context = self::getLogContext( $e, $catcher );
650if ( $extraData ) {
651 $context['extraData'] = $extraData;
652 }
653 $logger->error(
654 self::getLogNormalMessage( $e ),
655 $context
656 );
657
658 self::callLogExceptionHook( $e,false );
659 }
660 }
661
669privatestaticfunction logError(
670 ErrorException $e,
671 $level,
672 $catcher
673 ) {
674// The set_error_handler callback is independent from error_reporting.
675 $suppressed = ( error_reporting() & $e->getSeverity() ) === 0;
676if ( $suppressed ) {
677// Instead of discarding these entirely, give some visibility (but only
678// when debugging) to errors that were intentionally silenced via
679// the error silencing operator (@) or Wikimedia\AtEase.
680// To avoid clobbering Logstash results, set the level to DEBUG
681// and also send them to a dedicated channel (T193472).
682 $channel ='silenced-error';
683 $level = LogLevel::DEBUG;
684 }else {
685 $channel ='error';
686 }
687 $logger = LoggerFactory::getInstance( $channel );
688 $logger->log(
689 $level,
690 self::getLogNormalMessage( $e ),
691 self::getLogContext( $e, $catcher )
692 );
693
694 self::callLogExceptionHook( $e, $suppressed );
695 }
696
703privatestaticfunction callLogExceptionHook( Throwable $e,bool $suppressed ) {
704try {
705// It's possible for the exception handler to be triggered during service container
706// initialization, e.g. if an autoloaded file triggers deprecation warnings.
707// To avoid a difficult-to-debug autoload loop, avoid attempting to initialize the service
708// container here. (T380456).
709// The exception handler is also triggered when autoloading of HookRunner class fails,
710// > Uncaught Error: Class "MediaWiki\HookContainer\HookRunner" not found
711// Avoid use of the not-loaded class here, as that override the real error.
712if ( !MediaWikiServices::hasInstance() || !class_exists( HookRunner::class,false ) ) {
713return;
714 }
715
716 (new HookRunner(MediaWikiServices::getInstance()->getHookContainer() ) )
717 ->onLogException( $e, $suppressed );
718 }catch ( RecursiveServiceDependencyException ) {
719// An error from the HookContainer wiring will lead here (T379125)
720 }
721 }
722}
723
725class_alias( MWExceptionHandler::class,'MWExceptionHandler' );
wfIsCLI
wfIsCLI()
Check if we are running from the commandline.
DefinitionBootstrapHelperFunctions.php:93
MW_ENTRY_POINT
const MW_ENTRY_POINT
Definitionapi.php:21
MediaWiki\Debug\MWDebug
Debug toolbar.
DefinitionMWDebug.php:35
MediaWiki\Exception\MWExceptionHandler
Handler class for MWExceptions.
DefinitionMWExceptionHandler.php:27
MediaWiki\Exception\MWExceptionHandler\getStructuredExceptionData
static getStructuredExceptionData(Throwable $e, $catcher=self::CAUGHT_BY_OTHER)
Get a structured representation of a Throwable.
DefinitionMWExceptionHandler.php:597
MediaWiki\Exception\MWExceptionHandler\getRedactedTrace
static getRedactedTrace(Throwable $e)
Return a copy of a throwable's backtrace as an array.
DefinitionMWExceptionHandler.php:450
MediaWiki\Exception\MWExceptionHandler\getLogMessage
static getLogMessage(Throwable $e)
Get a message formatting the throwable message and its origin.
DefinitionMWExceptionHandler.php:497
MediaWiki\Exception\MWExceptionHandler\redactTrace
static redactTrace(array $trace)
Redact a stacktrace generated by Throwable::getTrace(), debug_backtrace() or similar means.
DefinitionMWExceptionHandler.php:464
MediaWiki\Exception\MWExceptionHandler\CAUGHT_BY_HANDLER
const CAUGHT_BY_HANDLER
Error caught and reported by this exception handler.
DefinitionMWExceptionHandler.php:29
MediaWiki\Exception\MWExceptionHandler\getLogContext
static getLogContext(Throwable $e, $catcher=self::CAUGHT_BY_OTHER)
Get a PSR-3 log event context from a Throwable.
DefinitionMWExceptionHandler.php:566
MediaWiki\Exception\MWExceptionHandler\logException
static logException(Throwable $e, $catcher=self::CAUGHT_BY_OTHER, $extraData=[])
Log a throwable to the exception log (if enabled).
DefinitionMWExceptionHandler.php:642
MediaWiki\Exception\MWExceptionHandler\report
static report(Throwable $e)
Report a throwable to the user.
DefinitionMWExceptionHandler.php:114
MediaWiki\Exception\MWExceptionHandler\getURL
static getURL()
If the exception occurred in the course of responding to a request, returns the requested URL.
DefinitionMWExceptionHandler.php:480
MediaWiki\Exception\MWExceptionHandler\handleFatalError
static handleFatalError()
Callback used as a registered shutdown function.
DefinitionMWExceptionHandler.php:333
MediaWiki\Exception\MWExceptionHandler\CAUGHT_BY_ENTRYPOINT
const CAUGHT_BY_ENTRYPOINT
Error caught and reported by a script entry point.
DefinitionMWExceptionHandler.php:31
MediaWiki\Exception\MWExceptionHandler\getRedactedTraceAsString
static getRedactedTraceAsString(Throwable $e)
Generate a string representation of a throwable's stack trace.
DefinitionMWExceptionHandler.php:392
MediaWiki\Exception\MWExceptionHandler\handleError
static handleError( $level, $message, $file=null, $line=null)
Handler for set_error_handler() callback notifications.
DefinitionMWExceptionHandler.php:241
MediaWiki\Exception\MWExceptionHandler\getLogNormalMessage
static getLogNormalMessage(Throwable $e)
Get a normalised message for formatting with PSR-3 log event context.
DefinitionMWExceptionHandler.php:525
MediaWiki\Exception\MWExceptionHandler\handleException
static handleException(Throwable $e, $catcher=self::CAUGHT_BY_OTHER)
Exception handler which simulates the appropriate catch() handling:
DefinitionMWExceptionHandler.php:222
MediaWiki\Exception\MWExceptionHandler\getPublicLogMessage
static getPublicLogMessage(Throwable $e)
DefinitionMWExceptionHandler.php:546
MediaWiki\Exception\MWExceptionHandler\installHandler
static installHandler(bool $logExceptionBacktrace=true, bool $propagateErrors=true)
Install handlers with PHP.
DefinitionMWExceptionHandler.php:78
MediaWiki\Exception\MWExceptionHandler\handleUncaughtException
static handleUncaughtException(Throwable $e)
Callback to use with PHP's set_exception_handler.
DefinitionMWExceptionHandler.php:194
MediaWiki\Exception\MWExceptionHandler\rollbackPrimaryChangesAndLog
static rollbackPrimaryChangesAndLog(Throwable $e, $catcher=self::CAUGHT_BY_OTHER)
Roll back any open database transactions and log the stack trace of the throwable.
DefinitionMWExceptionHandler.php:179
MediaWiki\Exception\MWExceptionHandler\CAUGHT_BY_OTHER
const CAUGHT_BY_OTHER
Error reported by direct logException() call.
DefinitionMWExceptionHandler.php:33
MediaWiki\Exception\MWExceptionHandler\$reservedMemory
static string null $reservedMemory
DefinitionMWExceptionHandler.php:36
MediaWiki\Exception\MWExceptionHandler\prettyPrintTrace
static prettyPrintTrace(array $trace, $pad='')
Generate a string representation of a stacktrace.
DefinitionMWExceptionHandler.php:405
MediaWiki\Exception\MWExceptionRenderer\AS_PRETTY
const AS_PRETTY
DefinitionMWExceptionRenderer.php:35
MediaWiki\Exception\MWExceptionRenderer\AS_RAW
const AS_RAW
DefinitionMWExceptionRenderer.php:34
MediaWiki\Exception\MWExceptionRenderer\output
static output(Throwable $e, $mode, ?Throwable $eNew=null)
DefinitionMWExceptionRenderer.php:69
MediaWiki\Exception\MWException
MediaWiki exception.
DefinitionMWException.php:24
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
DefinitionHookRunner.php:595
MediaWiki\Logger\LoggerFactory
Create PSR-3 logger objects.
DefinitionLoggerFactory.php:32
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
DefinitionMediaWikiServices.php:256
MediaWiki\MediaWikiServices\hasInstance
static hasInstance()
Returns true if an instance has already been initialized and can be obtained from getInstance().
DefinitionMediaWikiServices.php:323
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
DefinitionMediaWikiServices.php:344
MediaWiki\Request\WebRequest
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form,...
DefinitionWebRequest.php:40
Wikimedia\Rdbms\DBError
Database error base class.
DefinitionDBError.php:22
Wikimedia\Rdbms\DBQueryError
DefinitionDBQueryError.php:12
Wikimedia\Rdbms\LBFactory
DefinitionLBFactory.php:27
MediaWiki\Exception
DefinitionBadRequestError.php:7
MediaWiki
Helper trait for implementations \DAO.
Wikimedia\Leximorph\Traits\$logger
LoggerInterface $logger
The logger instance.
DefinitionSpecBasedFactoryTrait.php:33
$url
$url
Definitionopensearch_desc.php:23

[8]ページ先頭

©2009-2025 Movatter.jp