Merge "Moved some WANObjectCache number literals to constants"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 16 Sep 2015 17:20:26 +0000 (17:20 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 16 Sep 2015 17:20:26 +0000 (17:20 +0000)
includes/GlobalFunctions.php
includes/WebRequest.php
includes/password/EncryptedPassword.php
includes/resourceloader/ResourceLoader.php
includes/specials/SpecialEditTags.php
includes/specials/SpecialExport.php
tests/phpunit/includes/FauxRequestTest.php

index 2852561..f2e37d5 100644 (file)
@@ -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;
index 850f101..b4b8be9 100644 (file)
@@ -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
index 39da32d..6723793 100644 (file)
@@ -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 );
index 173fcc1..945985a 100644 (file)
@@ -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':
index 54f50d9..d2b2e70 100644 (file)
@@ -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();
                }
index 69b795d..39c4d77 100644 (file)
@@ -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
index eca5b39..07214b2 100644 (file)
@@ -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' )
+               );
+       }
 }