MediaWiki master
ResourceLoaderEntryPoint.php
Go to the documentation of this file.
1<?php
8
11
21
25 public function execute() {
26 $services = $this->getServiceContainer();
27
28 // Disable ChronologyProtector so that we don't wait for unrelated MediaWiki
29 // writes when getting database connections for ResourceLoader. (T192611)
30 $services->getChronologyProtector()->setEnabled( false );
31
32 $resourceLoader = $services->getResourceLoader();
33 $context = new Context(
34 $resourceLoader,
35 $this->getRequest(),
36 array_keys( $services->getSkinFactory()->getInstalledSkins() )
37 );
38
39 // T390929
40 $extraHeaders = [];
41 $hookRunner = new HookRunner( $services->getHookContainer() );
42 $hookRunner->onResourceLoaderBeforeResponse( $context, $extraHeaders );
43
44 // Respond to ResourceLoader request
45 $resourceLoader->respond( $context, $extraHeaders );
46
47 // Append any visible profiling data in a manner appropriate for the Content-Type
48 $profiler = Profiler::instance();
49 $profiler->setAllowOutput();
50 $profiler->logDataPageOutputOnly();
51 }
52
53 protected function doPrepareForOutput() {
54 // No-op.
55 // Do not call parent::doPrepareForOutput() to avoid
56 // commitMainTransaction() getting called.
57 }
58}
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Base class for entry point handlers.
getServiceContainer()
Returns the main service container.
Profiler base class that defines the interface and some shared functionality.
Definition Profiler.php:25
Context object that contains information about the state of a specific ResourceLoader web request.
Definition Context.php:32
Entry point implementation for ResourceLoader, which serves static CSS/JavaScript via MediaWiki\Resou...