MediaWiki master
ResourceLoaderEntryPoint.php
Go to the documentation of this file.
1<?php
22
24use Profiler;
25
35
39 public function execute() {
40 $services = $this->getServiceContainer();
41
42 // Disable ChronologyProtector so that we don't wait for unrelated MediaWiki
43 // writes when getting database connections for ResourceLoader. (T192611)
44 $services->getChronologyProtector()->setEnabled( false );
45
46 $resourceLoader = $services->getResourceLoader();
47 $context = new Context(
48 $resourceLoader,
49 $this->getRequest(),
50 array_keys( $services->getSkinFactory()->getInstalledSkins() )
51 );
52
53 // Respond to ResourceLoader request
54 $resourceLoader->respond( $context );
55
56 // Append any visible profiling data in a manner appropriate for the Content-Type
57 $profiler = Profiler::instance();
58 $profiler->setAllowOutput();
59 $profiler->logDataPageOutputOnly();
60 }
61
62 protected function doPrepareForOutput() {
63 // No-op.
64 // Do not call parent::doPrepareForOutput() to avoid
65 // commitMainTransaction() getting called.
66 }
67}
Base class for entry point handlers.
getServiceContainer()
Returns the main service container.
Context object that contains information about the state of a specific ResourceLoader web request.
Definition Context.php:46
Entry point implementation for ResourceLoader, which serves static CSS/JavaScript via MediaWiki\Resou...
Profiler base class that defines the interface and some shared functionality.
Definition Profiler.php:37
static instance()
Definition Profiler.php:105