*
* @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 ) {
*
* @see wfLoadExtension
* @param string[] $exts Array of extension names to load
+ * @since 1.25
*/
function wfLoadExtensions( array $exts ) {
global $wgExtensionDirectory;
* @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 ) {
*
* @see wfLoadExtensions
* @param string[] $skins Array of extension names to load
+ * @since 1.25
*/
function wfLoadSkins( array $skins ) {
global $wgStyleDirectory;
/**
* Initialise the header list
*/
- private function initHeaders() {
+ protected function initHeaders() {
if ( count( $this->headers ) ) {
return;
}
$this->protocol = $protocol;
}
+ /**
+ * Initialise the header list
+ */
+ protected function initHeaders() {
+ // Nothing to init
+ }
+
/**
* @param string $name
* @param string $default
const CHECK_KEY_TTL = 31536000; // 1 year
/** Seconds to keep lock keys around */
const LOCK_TTL = 5;
+ /** Default remaining TTL at which to consider pre-emptive regeneration */
+ const LOW_TTL = 10;
+ /** Default TTL for temporarily caching tombstoned keys */
+ const TEMP_TTL = 5;
/** Idiom for set()/getWithSetCallback() TTL */
const TTL_NONE = 0;
final public function getWithSetCallback(
$key, $callback, $ttl, array $checkKeys = array(), array $opts = array()
) {
- $lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( 10, $ttl );
+ $lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( self::LOW_TTL, $ttl );
$lockTSE = isset( $opts['lockTSE'] ) ? $opts['lockTSE'] : -1;
- $tempTTL = isset( $opts['tempTTL'] ) ? $opts['tempTTL'] : 5;
+ $tempTTL = isset( $opts['tempTTL'] ) ? $opts['tempTTL'] : self::TEMP_TTL;
// Get the current key value
$curTTL = null;
$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 );
$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':
// Either submit or create our form
if ( $this->isAllowed && $this->submitClicked ) {
- $this->submit( $request );
+ $this->submit();
} else {
$this->showForm();
}
*/
class SpecialExport extends SpecialPage {
private $curonly, $doExport, $pageLinkDepth, $templates;
- private $images;
public function __construct() {
parent::__construct( 'Export' );
$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' )
);
}
$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',
$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
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
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' )
+ );
+ }
}