Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ResourceLoaderEntryPoint | |
0.00% |
0 / 12 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
execute | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
doPrepareForOutput | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * This program is free software; you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License as published by |
5 | * the Free Software Foundation; either version 2 of the License, or |
6 | * (at your option) any later version. |
7 | * |
8 | * This program is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. |
12 | * |
13 | * You should have received a copy of the GNU General Public License along |
14 | * with this program; if not, write to the Free Software Foundation, Inc., |
15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
16 | * http://www.gnu.org/copyleft/gpl.html |
17 | * |
18 | * @file |
19 | */ |
20 | |
21 | namespace MediaWiki\ResourceLoader; |
22 | |
23 | use MediaWiki\MediaWikiEntryPoint; |
24 | use Profiler; |
25 | |
26 | /** |
27 | * Entry point implementation for @ref ResourceLoader, which serves static CSS/JavaScript |
28 | * via @ref MediaWiki\ResourceLoader\Module Module subclasses. |
29 | * |
30 | * @see load.php |
31 | * @ingroup ResourceLoader |
32 | * @ingroup entrypoint |
33 | */ |
34 | class ResourceLoaderEntryPoint extends MediaWikiEntryPoint { |
35 | |
36 | /** |
37 | * Main entry point |
38 | */ |
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 | } |