In your LocalSettings.php file, set:
- $wgMainCacheType = CACHE_MEMCACHED;;
+ $wgMainCacheType = CACHE_MEMCACHED;
$wgMemCachedServers = array( "127.0.0.1:11000" );
The wiki should then use memcached to cache various data. To use
* @return bool Whether or not an autoblock was inserted.
*/
function doAutoblock( $autoblockip, $justInserted = false ) {
- # Check if this IP address is already blocked
- $dbw = wfGetDB( DB_MASTER );
-
# If autoblocks are disabled, go away.
if ( !$this->mEnableAutoblock ) {
return;
@/**/$this->mConn = mysql_connect( $server, $user, $password, true );
}
if ($this->mConn === false) {
- $iplus = $i + 1;
+ #$iplus = $i + 1;
#wfLogDBError("Connect loop error $iplus of $max ($server): " . mysql_errno() . " - " . mysql_error()."\n");
}
}
}
if ( $this->mTitle->isCascadeProtected() ) {
# Is this page under cascading protection from some source pages?
- list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources();
+ list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
if ( count($cascadeSources) > 0 ) {
# Explain, and list the titles responsible
$notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n";
if ( !$handler ) {
return null;
}
- list( $thumbExt, $thumbMime ) = self::getThumbType( $this->extension, $this->mime );
+ list( $thumbExt, /* $thumbMime */ ) = self::getThumbType( $this->extension, $this->mime );
$thumbName = $handler->makeParamString( $params ) . '-' . $this->name;
if ( $thumbExt != $this->extension ) {
$thumbName .= ".$thumbExt";
$dir = wfImageThumbDir( $this->name, $shared );
$urls = array();
foreach ( $files as $file ) {
- $m = array();
# Check that the base image name is part of the thumb name
# This is a basic sanity check to avoid erasing unrelated directories
if ( strpos( $file, $this->name ) !== false ) {
}
function getExifData() {
- global $wgRequest;
$handler = $this->getHandler();
if ( !$handler || $handler->getMetadataType( $this ) != 'exif' ) {
return array();
*/
function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $params = array(), $framed=false , $manual_thumb = "" ) {
global $wgStylePath, $wgContLang;
- $thumbUrl = '';
- $error = '';
$page = isset( $params['page'] ) ? $params['page'] : false;
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
- list( $cascadeSources, $restrictions ) = $wgTitle->getCascadeProtectionSources();
+ list( $cascadeSources, /* $restrictions */ ) = $wgTitle->getCascadeProtectionSources();
# Determine if protection is due to the page being a system message
# and show an appropriate explanation
# Look at the first character
if( $target != '' && $target{0} == '/' ) {
# / at end means we don't want the slash to be shown
+ $m = array();
$trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );
if( $trailingSlashes ) {
$noslash = $target = substr( $target, 1, -strlen($m[0][0]) );
# these conditions would have gone into recentchanges, which we aren't
# supposed to be updating
if( is_object( $skin ) ) {
- list( $cur, $prev, $auto ) = $params;
+ list( $cur, /* $prev */, $auto ) = $params;
# Standard link to the page in question
$link = $skin->makeLinkObj( $title );
# Generate a diff link
return;
}
- list( $cascadeSources, $restrictions ) = $this->mTitle->getCascadeProtectionSources();
+ list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources();
if ( "" != $err ) {
$wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
$num = $dbr->numRows($res);
$this->preprocessResults( $dbr, $res );
- $sk = $wgUser->getSkin();
# Top header and navigation
if( $shownavigation ) {
$term = preg_replace('/:/', ' ', $term);
$searchstring = '';
+ $m = array();
if( preg_match_all('/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
foreach( $m as $terms ) {
if (strlen($terms[1])) {
var $namespace = '', $mDb;
function __construct( $target, $namespace = false ) {
- global $wgUser;
-
parent::__construct();
foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
$this->messages[$msg] = wfMsgExt( $msg, array( 'escape') );
$this->doQuery();
}
$batch = new LinkBatch;
- $db = $this->mDb;
$this->mResult->rewind();
$conds[] = 'page_id=pr_page';
$conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
- if( $this->sizetype=='min' )
+ if( $this->sizetype=='min' ) {
$conds[] = 'page_len>=' . $this->size;
- else if( $this->sizetype=='max' )
+ } else if( $this->sizetype=='max' ) {
$conds[] = 'page_len<=' . $this->size;
+ }
if( $this->level )
$conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
* Please use the accessor functions
*/
- /**#@+
+ /**#@+
* @private
*/
wfDebug( "$err\n" );
return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
}
- list( $loader, $colorStyle, $saveType ) = $typemap[$mimeType];
+ list( $loader, /* $colorStyle */, $saveType ) = $typemap[$mimeType];
if( !function_exists( $loader ) ) {
$err = "Incomplete GD library configuration: missing function $loader";
$height = $params['height'];
$srcPath = $image->getImagePath();
$page = $params['page'];
- $pageCount = $this->pageCount( $image );
if ( $page > $this->pageCount( $image ) ) {
return new MediaTransformError( 'thumbnail_error', $width, $height, wfMsg( 'djvu_page_error' ) );
}
* @return true if removed, false otherwise
*/
function removeBadFile( $dstPath, $retval = 0 ) {
- $removed = false;
if( file_exists( $dstPath ) ) {
$thumbstat = stat( $dstPath );
if( $thumbstat['size'] == 0 || $retval != 0 ) {
$clientHeight = $params['height'];
$physicalWidth = $params['physicalWidth'];
$physicalHeight = $params['physicalHeight'];
- $srcWidth = $image->getWidth();
- $srcHeight = $image->getHeight();
$srcPath = $image->getImagePath();
if ( $flags & self::TRANSFORM_LATER ) {