# No match, generate an edit URL
$title = Title::newFromText( $term );
if ( !is_null( $title ) ) {
- global $wgGoToEdit;
wfRunHooks( 'SpecialSearchNogomatch', array( &$title ) );
wfDebugLog( 'nogomatch', $title->getFullText(), 'private' );
# If the feature is enabled, go straight to the edit page
- if ( $wgGoToEdit ) {
+ if ( $this->getConfig()->get( 'GoToEdit' ) ) {
$this->getOutput()->redirect( $title->getFullURL( array( 'action' => 'edit' ) ) );
return;
* @param string $term
*/
public function showResults( $term ) {
- global $wgDisableTextSearch, $wgSearchForwardUrl, $wgContLang, $wgScript;
+ global $wgContLang;
$profile = new ProfileSection( __METHOD__ );
$search = $this->getSearchEngine();
$out = $this->getOutput();
- if ( $wgDisableTextSearch ) {
- if ( $wgSearchForwardUrl ) {
- $url = str_replace( '$1', urlencode( $term ), $wgSearchForwardUrl );
+ if ( $this->getConfig()->get( 'DisableTextSearch' ) ) {
+ $searchFowardUrl = $this->getConfig()->get( 'SearchForwardUrl' );
+ if ( $searchFowardUrl ) {
+ $url = str_replace( '$1', urlencode( $term ), $searchFowardUrl );
$out->redirect( $url );
} else {
$out->addHTML(
array(
'id' => ( $this->profile === 'advanced' ? 'powersearch' : 'search' ),
'method' => 'get',
- 'action' => $wgScript
+ 'action' => wfScript(),
)
)
);
}
public function checkExecutePermissions( User $user ) {
- global $wgReadOnlyFile;
-
parent::checkExecutePermissions( $user );
# If the lock file isn't writable, we can do sweet bugger all
- if ( !file_exists( $wgReadOnlyFile ) ) {
+ if ( !file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) {
throw new ErrorPageError( 'lockdb', 'databasenotlocked' );
}
}
}
public function onSubmit( array $data ) {
- global $wgReadOnlyFile;
-
if ( !$data['Confirm'] ) {
return Status::newFatal( 'locknoconfirm' );
}
+ $readOnlyFile = $this->getConfig()->get( 'ReadOnlyFile' );
wfSuppressWarnings();
- $res = unlink( $wgReadOnlyFile );
+ $res = unlink( $readOnlyFile );
wfRestoreWarnings();
if ( $res ) {
return Status::newGood();
} else {
- return Status::newFatal( 'filedeleteerror', $wgReadOnlyFile );
+ return Status::newFatal( 'filedeleteerror', $readOnlyFile );
}
}
}
function getQueryInfo() {
- global $wgCountCategorizedImagesAsUsed;
$retval = array(
'tables' => array( 'image', 'imagelinks' ),
'fields' => array(
'join_conds' => array( 'imagelinks' => array( 'LEFT JOIN', 'il_to = img_name' ) )
);
- if ( $wgCountCategorizedImagesAsUsed ) {
+ if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) {
// Order is significant
$retval['tables'] = array( 'image', 'page', 'categorylinks',
'imagelinks' );
* @return bool Success
*/
private function outputThumbFromStash( $file, $params ) {
- // this global, if it exists, points to a "scaler", as you might find in
+ $flags = 0;
+ // this config option, if it exists, points to a "scaler", as you might find in
// the Wikimedia Foundation cluster. See outputRemoteScaledThumb(). This
// is part of our horrible NFS-based system, we create a file on a mount
// point here, but fetch the scaled file from somewhere else that
// happens to share it over NFS.
- global $wgUploadStashScalerBaseUrl;
-
- $flags = 0;
- if ( $wgUploadStashScalerBaseUrl ) {
+ if ( $this->getConfig()->get( 'UploadStashScalerBaseUrl' ) ) {
$this->outputRemoteScaledThumb( $file, $params, $flags );
} else {
$this->outputLocallyScaledThumb( $file, $params, $flags );
* @return bool Success
*/
private function outputRemoteScaledThumb( $file, $params, $flags ) {
- // This global probably looks something like
+ // This option probably looks something like
// 'http://upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use
// trailing slash.
- global $wgUploadStashScalerBaseUrl;
- $scalerBaseUrl = $wgUploadStashScalerBaseUrl;
+ $scalerBaseUrl = $this->getConfig()->get( 'UploadStashScalerBaseUrl' );
if ( preg_match( '/^\/\//', $scalerBaseUrl ) ) {
// this is apparently a protocol-relative URL, which makes no sense in this context,
'</table>'
);
$table.tablesorter();
- assert.equal( 0,
- $table.find( '#A2' ).prop( 'headerIndex' ),
- 'A2 should be a sort header'
+ assert.equal( $table.find( '#A2' ).prop( 'headerIndex' ),
+ 0,
+ 'A2 should not be a sort header'
);
- assert.equal( 1, // should be 2
- $table.find( '#C1' ).prop( 'headerIndex' ),
+ assert.equal( $table.find( '#C1' ).prop( 'headerIndex' ),
+ 1,
'C1 should be a sort header, but will sort the wrong column'
);
} );
'</tbody></table>' );
$table.tablesorter();
- assert.equal( 2, $table.find( 'tr:eq(1) th:eq(1)').prop('headerIndex'), 'Incorrect index of sort header' );
+ assert.equal( $table.find( 'tr:eq(1) th:eq(1)').prop('headerIndex'),
+ 2,
+ 'Incorrect index of sort header' );
}
);