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 );
51
52 // Respond to ResourceLoader request
53 $resourceLoader->respond( $context );
54
55 // Append any visible profiling data in a manner appropriate for the Content-Type
56 $profiler = Profiler::instance();
57 $profiler->setAllowOutput();
58 $profiler->logDataPageOutputOnly();
59 }
60
61 protected function doPrepareForOutput() {
62 // No-op.
63 // Do not call parent::doPrepareForOutput() to avoid
64 // commitMainTransaction() getting called.
65 }
66}
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:45
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