wiki.techinc.nl/load.php
Timo Tijhof be2dbcc219 ResourceLoader: Follow-up creation of ResourceLoaderEntryPoint
Follows-up Iadea44b7867f48a2be6ccbf00c0e56911a5af74e.

ResourceLoaderEntryPoint:
* Rename from Resource to ResourceLoader, as it is the entry point
  for ResourceLoader.
* Fix accidental use of ingroup on the file docblock
  instead of the class.
  https://phabricator.wikimedia.org/F42046908
* Fix broken "see" reference to "/load.php" on the ResourceEntryPoint
  class on doc.wikimedia.org. Files are indexed in Doxygen by full
  name without leading slash.
* Remove load.php from docgroup, akin to index.php.

tests:
* Remove unrelated Rest namespace from test suite.
* Remove redundant default values in newResourceLoader(),
  especially null values were confusing by showing an
  apparent intent to set a value without actually
  isplacing the default, given that isset/?? treat
  set null as not set.
* Simplify test by using the built-in startup module instead.

EntryPoint:
* Remove comment in test about doPostOutputShutdown.
  It sounded like it was explaining that we use getCapturedOutput()
  instead of run() because the latter calls doPostOutputShutdown
  which we want to avoid. Except, we don't avoid it,
  since run() is called and does call doPostOutputShutdown.
  Unclear what it was explaining.
* Improve docs around getCapturedOutput() in the base class,
  and make explicit that this seemingly unused complexity
  exists for the purpose of testing.

Bug: T354216
Change-Id: I5139fda90a3d5ac7ea1ed917c8045d1a09961d78
2024-02-22 22:30:39 +00:00

42 lines
1.4 KiB
PHP

<?php
/**
* @see MediaWiki\ResourceLoader\ResourceLoaderEntryPoint
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @author Roan Kattouw
* @author Trevor Parscal
*/
use MediaWiki\Context\RequestContext;
use MediaWiki\EntryPointEnvironment;
use MediaWiki\MediaWikiServices;
use MediaWiki\ResourceLoader\ResourceLoaderEntryPoint;
// This endpoint is supposed to be independent of request cookies and other
// details of the session. Enforce this constraint with respect to session use.
define( 'MW_NO_SESSION', 1 );
define( 'MW_ENTRY_POINT', 'load' );
require __DIR__ . '/includes/WebStart.php';
( new ResourceLoaderEntryPoint(
RequestContext::getMain(),
new EntryPointEnvironment(),
MediaWikiServices::getInstance()
) )->run();