From: jenkins-bot Date: Wed, 16 Sep 2015 17:20:26 +0000 (+0000) Subject: Merge "Moved some WANObjectCache number literals to constants" X-Git-Tag: 1.31.0-rc.0~10000 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=8fbeca1e438be9fc9098d3e19d0763f96419c3ac;hp=2df6d541826d1a7454b3fb22a25462cd44ce15b5 Merge "Moved some WANObjectCache number literals to constants" --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 28525610d5..f2e37d557c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -171,6 +171,7 @@ if ( !function_exists( 'hash_equals' ) ) { * * @param string $ext Name of the extension to load * @param string|null $path Absolute path of where to find the extension.json file + * @since 1.25 */ function wfLoadExtension( $ext, $path = null ) { if ( !$path ) { @@ -191,6 +192,7 @@ function wfLoadExtension( $ext, $path = null ) { * * @see wfLoadExtension * @param string[] $exts Array of extension names to load + * @since 1.25 */ function wfLoadExtensions( array $exts ) { global $wgExtensionDirectory; @@ -206,6 +208,7 @@ function wfLoadExtensions( array $exts ) { * @see wfLoadExtension * @param string $skin Name of the extension to load * @param string|null $path Absolute path of where to find the skin.json file + * @since 1.25 */ function wfLoadSkin( $skin, $path = null ) { if ( !$path ) { @@ -220,6 +223,7 @@ function wfLoadSkin( $skin, $path = null ) { * * @see wfLoadExtensions * @param string[] $skins Array of extension names to load + * @since 1.25 */ function wfLoadSkins( array $skins ) { global $wgStyleDirectory; diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 850f10103f..b4b8be9b15 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -871,7 +871,7 @@ class WebRequest { /** * Initialise the header list */ - private function initHeaders() { + protected function initHeaders() { if ( count( $this->headers ) ) { return; } @@ -1324,6 +1324,13 @@ class FauxRequest extends WebRequest { $this->protocol = $protocol; } + /** + * Initialise the header list + */ + protected function initHeaders() { + // Nothing to init + } + /** * @param string $name * @param string $default diff --git a/includes/password/EncryptedPassword.php b/includes/password/EncryptedPassword.php index 39da32d1aa..6723793cc1 100644 --- a/includes/password/EncryptedPassword.php +++ b/includes/password/EncryptedPassword.php @@ -47,7 +47,7 @@ class EncryptedPassword extends ParameterizedPassword { $secret, 0, base64_decode( $this->args[0] ) ) ); } else { - $underlyingPassword = $this->factory->newFromType( $this->config['underlying'], $this->config ); + $underlyingPassword = $this->factory->newFromType( $this->config['underlying'] ); } $underlyingPassword->crypt( $password ); diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 173fcc1808..945985a9c2 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1011,7 +1011,7 @@ MESSAGE; $out .= $scripts; } elseif ( is_array( $scripts ) ) { // ...except when $scripts is an array of URLs - $out .= self::makeLoaderImplementScript( $name, $scripts, array(), array() ); + $out .= self::makeLoaderImplementScript( $name, $scripts, array(), array(), array() ); } break; case 'styles': diff --git a/includes/specials/SpecialEditTags.php b/includes/specials/SpecialEditTags.php index 54f50d9ed7..d2b2e70846 100644 --- a/includes/specials/SpecialEditTags.php +++ b/includes/specials/SpecialEditTags.php @@ -123,7 +123,7 @@ class SpecialEditTags extends UnlistedSpecialPage { // Either submit or create our form if ( $this->isAllowed && $this->submitClicked ) { - $this->submit( $request ); + $this->submit(); } else { $this->showForm(); } diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 69b795d9e4..39c4d77111 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -30,7 +30,6 @@ */ class SpecialExport extends SpecialPage { private $curonly, $doExport, $pageLinkDepth, $templates; - private $images; public function __construct() { parent::__construct( 'Export' ); @@ -46,7 +45,6 @@ class SpecialExport extends SpecialPage { $this->doExport = false; $request = $this->getRequest(); $this->templates = $request->getCheck( 'templates' ); - $this->images = $request->getCheck( 'images' ); // Doesn't do anything yet $this->pageLinkDepth = $this->validateLinkDepth( $request->getIntOrNull( 'pagelink-depth' ) ); @@ -279,13 +277,6 @@ class SpecialExport extends SpecialPage { } $formDescriptor += array( - /* Enable this when we can do something useful exporting/importing image information. - 'images' => array( - 'type' => 'check', - 'name' => 'images', - 'id' => 'wpExportImages', - 'default' => false, - ),*/ 'wpDownload' => array( 'type' => 'check', 'name' =>'wpDownload', @@ -359,11 +350,6 @@ class SpecialExport extends SpecialPage { $pageSet = $this->getPageLinks( $inputPages, $pageSet, $linkDepth ); } - // Enable this when we can do something useful exporting/importing image information. - // if( $this->images ) ) { - // $pageSet = $this->getImages( $inputPages, $pageSet ); - // } - $pages = array_keys( $pageSet ); // Normalize titles to the same format and remove dupes, see bug 17374 @@ -549,24 +535,6 @@ class SpecialExport extends SpecialPage { return $pageSet; } - /** - * Expand a list of pages to include images used in those pages. - * - * @param array $inputPages List of titles to look up - * @param array $pageSet Associative array indexed by titles for output - * - * @return array Associative array index by titles - */ - private function getImages( $inputPages, $pageSet ) { - return $this->getLinks( - $inputPages, - $pageSet, - 'imagelinks', - array( 'namespace' => NS_FILE, 'title' => 'il_to' ), - array( 'page_id=il_from' ) - ); - } - /** * Expand a list of pages to include items used in those pages. * @param array $inputPages Array of page titles diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index eca5b395fb..07214b215c 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -20,4 +20,32 @@ class FauxRequestTest extends MediaWikiTestCase { array( 'text/plain', 'text/html' ) ); } + + /** + * @covers FauxRequest::getAllHeaders + */ + public function testGetAllHeaders() { + $_SERVER['HTTP_TEST'] = 'Example'; + + $request = new FauxRequest(); + + $this->assertEquals( + array(), + $request->getAllHeaders() + ); + } + + /** + * @covers FauxRequest::getHeader + */ + public function testGetHeader() { + $_SERVER['HTTP_TEST'] = 'Example'; + + $request = new FauxRequest(); + + $this->assertEquals( + false, + $request->getHeader( 'test' ) + ); + } }