global $wgJobClasses;
if ( isset( $wgJobClasses[$command] ) ) {
$class = $wgJobClasses[$command];
+
return new $class( $title, $params, $id );
}
throw new MWException( "Invalid job command `{$command}`" );
// Likewise for jobs with different delay times
unset( $info['params']['jobReleaseTimestamp'] );
}
+
return $info;
}
if ( $paramString !== '' ) {
$s .= ' ' . $paramString;
}
+
return $s;
} else {
return "{$this->command} $paramString";
if ( !( $obj instanceof self ) ) {
throw new MWException( "Class '$class' is not a " . __CLASS__ . " class." );
}
+
return $obj;
}
wfProfileIn( __METHOD__ );
$res = $this->doIsEmpty();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$res = $this->doGetSize();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$res = $this->doGetAcquiredCount();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$res = $this->doGetDelayedCount();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$res = $this->doGetAbandonedCount();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$ok = $this->doBatchPush( $jobs, $flags );
wfProfileOut( __METHOD__ );
+
return $ok;
}
JobQueue::incrStats( 'job-pop-duplicate', $this->type );
$job = DuplicateJob::newFromJob( $job ); // convert to a no-op
}
- } catch ( MWException $e ) {} // don't lose jobs over this
+ } catch ( MWException $e ) {
+ // don't lose jobs over this
+ }
return $job;
}
wfProfileIn( __METHOD__ );
$ok = $this->doAck( $job );
wfProfileOut( __METHOD__ );
+
return $ok;
}
wfProfileIn( __METHOD__ );
$ok = $this->doDeduplicateRootJob( $job );
wfProfileOut( __METHOD__ );
+
return $ok;
}
wfProfileIn( __METHOD__ );
$isDuplicate = $this->doIsRootJobOldDuplicate( $job );
wfProfileOut( __METHOD__ );
+
return $isDuplicate;
}
*/
protected function getRootJobCacheKey( $signature ) {
list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
+
return wfForeignMemcKey( $db, $prefix, 'jobqueue', $this->type, 'rootjob', $signature );
}
wfProfileIn( __METHOD__ );
$res = $this->doDelete();
wfProfileOut( __METHOD__ );
+
return $res;
}
* @see JobQueue::waitForBackups()
* @return void
*/
- protected function doWaitForBackups() {}
+ protected function doWaitForBackups() {
+ }
/**
* Return a map of task names to task definition maps.
foreach ( $tasks as $name => &$def ) {
$def['name'] = $name;
}
+
return $tasks;
}
* @see JobQueue::flushCaches()
* @return void
*/
- protected function doFlushCaches() {}
+ protected function doFlushCaches() {
+ }
/**
* Get an iterator to traverse over all available jobs in this queue.
*/
final public function getSiblingQueuesWithJobs( array $types ) {
$section = new ProfileSection( __METHOD__ );
+
return $this->doGetSiblingQueuesWithJobs( $types );
}
*/
final public function getSiblingQueueSizes( array $types ) {
$section = new ProfileSection( __METHOD__ );
+
return $this->doGetSiblingQueueSizes( $types );
}
* @ingroup JobQueue
* @since 1.22
*/
-class JobQueueError extends MWException {}
-class JobQueueConnectionError extends JobQueueError {}
+class JobQueueError extends MWException {
+}
+
+class JobQueueConnectionError extends JobQueueError {
+}
$that = $this;
$method = __METHOD__;
$dbw->onTransactionIdle(
- function() use ( $dbw, $that, $jobs, $flags, $method ) {
+ function () use ( $dbw, $that, $jobs, $flags, $method ) {
$that->doBatchPushInternal( $dbw, $jobs, $flags, $method );
}
);
$dbw->commit( __METHOD__, 'flush' ); // flush existing transaction
$autoTrx = $dbw->getFlag( DBO_TRX ); // get current setting
$dbw->clearFlag( DBO_TRX ); // make each query its own transaction
- $scopedReset = new ScopedCallback( function() use ( $dbw, $autoTrx ) {
+ $scopedReset = new ScopedCallback( function () use ( $dbw, $autoTrx ) {
$dbw->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore old setting
} );
$dbw->commit( __METHOD__, 'flush' ); // flush existing transaction
$autoTrx = $dbw->getFlag( DBO_TRX ); // get current setting
$dbw->clearFlag( DBO_TRX ); // make each query its own transaction
- $scopedReset = new ScopedCallback( function() use ( $dbw, $autoTrx ) {
+ $scopedReset = new ScopedCallback( function () use ( $dbw, $autoTrx ) {
$dbw->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore old setting
} );
// jobs to become no-ops without any actual jobs that made them redundant.
$dbw = $this->getMasterDB();
$cache = $this->dupCache;
- $dbw->onTransactionIdle( function() use ( $cache, $params, $key, $dbw ) {
+ $dbw->onTransactionIdle( function () use ( $cache, $params, $key, $dbw ) {
$timestamp = $cache->get( $key ); // current last timestamp of this job
if ( $timestamp && $timestamp >= $params['rootJobTimestamp'] ) {
return true; // a newer version of this root job was enqueued
} catch ( DBError $e ) {
$this->throwDBException( $e );
}
+
return true;
}
return new MappedIterator(
$dbr->select( 'job', '*',
array( 'job_cmd' => $this->getType(), 'job_token' => '' ) ),
- function( $row ) use ( $dbr ) {
+ function ( $row ) use ( $dbr ) {
$job = Job::factory(
$row->job_cmd,
Title::makeTitle( $row->job_namespace, $row->job_title ),
foreach ( $res as $row ) {
$types[] = $row->job_cmd;
}
+
return $types;
}
foreach ( $res as $row ) {
$sizes[$row->job_cmd] = (int)$row->count;
}
+
return $sizes;
}
__METHOD__
);
$ids = array_map(
- function( $o ) {
+ function ( $o ) {
return $o->job_id;
}, iterator_to_array( $res )
);
// the IDs first means that the UPDATE can be done by primary key (less deadlocks).
$res = $dbw->select( 'job', 'job_id', $conds, __METHOD__ );
$ids = array_map(
- function( $o ) {
+ function ( $o ) {
return $o->job_id;
}, iterator_to_array( $res )
);
*/
protected function insertFields( Job $job ) {
$dbw = $this->getMasterDB();
+
return array(
// Fields that describe the nature of the job
- 'job_cmd' => $job->getType(),
+ 'job_cmd' => $job->getType(),
'job_namespace' => $job->getTitle()->getNamespace(),
- 'job_title' => $job->getTitle()->getDBkey(),
- 'job_params' => self::makeBlob( $job->getParams() ),
+ 'job_title' => $job->getTitle()->getDBkey(),
+ 'job_params' => self::makeBlob( $job->getParams() ),
// Additional job metadata
- 'job_id' => $dbw->nextSequenceValue( 'job_job_id_seq' ),
+ 'job_id' => $dbw->nextSequenceValue( 'job_job_id_seq' ),
'job_timestamp' => $dbw->timestamp(),
- 'job_sha1' => wfBaseConvert(
+ 'job_sha1' => wfBaseConvert(
sha1( serialize( $job->getDeduplicationInfo() ) ),
16, 36, 31
),
- 'job_random' => mt_rand( 0, self::MAX_JOB_RANDOM )
+ 'job_random' => mt_rand( 0, self::MAX_JOB_RANDOM )
);
}
$lb = ( $this->cluster !== false )
? wfGetLBFactory()->getExternalLB( $this->cluster, $this->wiki )
: wfGetLB( $this->wiki );
+
return $lb->getConnectionRef( $index, array(), $this->wiki );
}
private function getCacheKey( $property ) {
list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
$cluster = is_string( $this->cluster ) ? $this->cluster : 'main';
+
return wfForeignMemcKey( $db, $prefix, 'jobqueue', $cluster, $this->type, $property );
}
class JobQueueFederated extends JobQueue {
/** @var Array (partition name => weight) reverse sorted by weight */
protected $partitionMap = array();
+
/** @var Array (partition name => JobQueue) reverse sorted by weight */
protected $partitionQueues = array();
+
/** @var HashRing */
protected $partitionPushRing;
+
/** @var BagOStuff */
protected $cache;
- protected $maxPartitionsTry; // integer; maximum number of partitions to try
+ protected $maxPartitionsTry; // integer; maximum number of partitions to try
const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
// Get the config to pass to merge into each partition queue config
$baseConfig = $params;
foreach ( array( 'class', 'sectionsByWiki', 'maxPartitionsTry',
- 'partitionsBySection', 'configByPartition', 'partitionsNoPush' ) as $o )
- {
+ 'partitionsBySection', 'configByPartition', 'partitionsNoPush' ) as $o
+ ) {
unset( $baseConfig[$o] ); // partition queue doesn't care about this
}
// Get the partition queue objects
try {
if ( !$queue->doIsEmpty() ) {
$this->cache->add( $key, 'false', self::CACHE_TTL_LONG );
+
return false;
}
} catch ( JobQueueError $e ) {
}
$this->cache->add( $key, 'true', self::CACHE_TTL_LONG );
+
return true;
}
}
$this->cache->set( $key, $count, self::CACHE_TTL_SHORT );
+
return $count;
}
throw new JobQueueError(
"Could not insert job(s), {$this->maxPartitionsTry} partitions tried." );
}
+
return true;
}
}
if ( $job ) {
$job->metadata['QueuePartition'] = $partition;
+
return $job;
} else {
unset( $partitionsTry[$partition] ); // blacklist partition
}
$this->cache->set( $key, 'true', JobQueueDB::CACHE_TTL_LONG );
+
return false;
}
if ( !isset( $job->metadata['QueuePartition'] ) ) {
throw new MWException( "The given job has no defined partition name." );
}
+
return $this->partitionQueues[$job->metadata['QueuePartition']]->ack( $job );
}
return $this->partitionQueues[$partitions[1]]->doIsRootJobOldDuplicate( $job );
}
}
+
return false;
}
return $this->partitionQueues[$partitions[1]]->doDeduplicateRootJob( $job );
}
}
+
return false;
}
$tasks["{$partition}:{$task}"] = $def;
}
}
+
return $tasks;
}
foreach ( $this->partitionQueues as $queue ) {
$iterator->append( $queue->getAllQueuedJobs() );
}
+
return $iterator;
}
foreach ( $this->partitionQueues as $queue ) {
$iterator->append( $queue->getAllDelayedJobs() );
}
+
return $iterator;
}
MWExceptionHandler::logException( $e );
}
}
+
return array_values( $result );
}
MWExceptionHandler::logException( $e );
}
}
+
return $result;
}
*/
private function getCacheKey( $property ) {
list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
+
return wfForeignMemcKey( $db, $prefix, 'jobqueue', $this->type, $property );
}
}
if ( !isset( self::$instances[$wiki] ) ) {
self::$instances[$wiki] = new self( $wiki );
}
+
return self::$instances[$wiki];
}
if ( !$job ) {
JobQueueAggregator::singleton()->notifyQueueEmpty( $this->wiki, $qtype );
}
+
return $job;
} else { // any job in the "default" jobs types
if ( $flags & self::USE_CACHE ) {
}
}
}
+
return $types;
}
}
}
}
+
return $sizeMap;
}
// later jobs have not been done yet. This helps throttle queue spam.
$deprioritized = !$this->get( 'refreshLinks' )->isEmpty();
$this->cache->set( 'isDeprioritized', $type, $deprioritized );
+
return $deprioritized;
}
+
return false;
}
if ( $definition['period'] <= 0 ) {
continue; // disabled
} elseif ( !isset( $lastRuns[$type][$task] )
- || $lastRuns[$type][$task] < ( time() - $definition['period'] ) )
- {
+ || $lastRuns[$type][$task] < ( time() - $definition['period'] )
+ ) {
try {
if ( call_user_func( $definition['callback'] ) !== null ) {
$tasksRun[$type][$task] = time();
}
}
- $wgMemc->merge( $key, function( $cache, $key, $lastRuns ) use ( $tasksRun ) {
+ $wgMemc->merge( $key, function ( $cache, $key, $lastRuns ) use ( $tasksRun ) {
if ( is_array( $lastRuns ) ) {
foreach ( $tasksRun as $type => $tasks ) {
foreach ( $tasks as $task => $timestamp ) {
if ( !isset( $lastRuns[$type][$task] )
- || $timestamp > $lastRuns[$type][$task] )
- {
+ || $timestamp > $lastRuns[$type][$task]
+ ) {
$lastRuns[$type][$task] = $timestamp;
}
}
} else {
$lastRuns = $tasksRun;
}
+
return $lastRuns;
} );
} else {
$value = $wgConf->getConfig( $this->wiki, $name );
$wgMemc->set( $key, array( 'v' => $value ), 86400 + mt_rand( 0, 86400 ) );
+
return $value;
}
}
$conn->multi( Redis::PIPELINE );
$conn->zSize( $this->getQueueKey( 'z-claimed' ) );
$conn->zSize( $this->getQueueKey( 'z-abandoned' ) );
+
return array_sum( $conn->exec() );
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
}
if ( $failed > 0 ) {
wfDebugLog( 'JobQueueRedis', "Could not insert {$failed} {$this->type} job(s)." );
+
return false;
}
JobQueue::incrStats( 'job-insert', $this->type, count( $items ) );
if ( !$res ) {
wfDebugLog( 'JobQueueRedis', "Could not acknowledge {$this->type} job." );
+
return false;
}
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
}
}
+
return true;
}
if ( $timestamp && $timestamp >= $params['rootJobTimestamp'] ) {
return true; // a newer version of this root job was enqueued
}
+
// Update the timestamp of the last root job started at the location...
return $conn->set( $key, $params['rootJobTimestamp'], self::ROOTJOB_TTL ); // 2 weeks
} catch ( RedisException $e ) {
foreach ( $props as $prop ) {
$keys[] = $this->getQueueKey( $prop );
}
+
return ( $conn->delete( $keys ) !== false );
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
$conn = $this->getConnection();
try {
$that = $this;
+
return new MappedIterator(
$conn->lRange( $this->getQueueKey( 'l-unclaimed' ), 0, -1 ),
- function( $uid ) use ( $that, $conn ) {
+ function ( $uid ) use ( $that, $conn ) {
return $that->getJobFromUidInternal( $uid, $conn );
},
- array( 'accept' => function ( $job ) { return is_object( $job ); } )
+ array( 'accept' => function ( $job ) {
+ return is_object( $job );
+ } )
);
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
$conn = $this->getConnection();
try {
$that = $this;
+
return new MappedIterator( // delayed jobs
$conn->zRange( $this->getQueueKey( 'z-delayed' ), 0, -1 ),
- function( $uid ) use ( $that, $conn ) {
+ function ( $uid ) use ( $that, $conn ) {
return $that->getJobFromUidInternal( $uid, $conn );
},
- array( 'accept' => function ( $job ) { return is_object( $job ); } )
+ array( 'accept' => function ( $job ) {
+ return is_object( $job );
+ } )
);
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
}
+
return $sizes;
}
$title = Title::makeTitle( $item['namespace'], $item['title'] );
$job = Job::factory( $item['type'], $title, $item['params'] );
$job->metadata['uuid'] = $item['uuid'];
+
return $job;
} catch ( RedisException $e ) {
$this->throwRedisException( $this->server, $conn, $e );
'period' => 300 // 5 minutes
);
}
+
return $tasks;
}
protected function getNewJobFields( Job $job ) {
return array(
// Fields that describe the nature of the job
- 'type' => $job->getType(),
- 'namespace' => $job->getTitle()->getNamespace(),
- 'title' => $job->getTitle()->getDBkey(),
- 'params' => $job->getParams(),
+ 'type' => $job->getType(),
+ 'namespace' => $job->getTitle()->getNamespace(),
+ 'title' => $job->getTitle()->getDBkey(),
+ 'params' => $job->getParams(),
// Some jobs cannot run until a "release timestamp"
- 'rtimestamp' => $job->getReleaseTimestamp() ?: 0,
+ 'rtimestamp' => $job->getReleaseTimestamp() ? : 0,
// Additional job metadata
- 'uuid' => UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ),
- 'sha1' => $job->ignoreDuplicates()
- ? wfBaseConvert( sha1( serialize( $job->getDeduplicationInfo() ) ), 16, 36, 31 )
- : '',
- 'timestamp' => time() // UNIX timestamp
+ 'uuid' => UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ),
+ 'sha1' => $job->ignoreDuplicates()
+ ? wfBaseConvert( sha1( serialize( $job->getDeduplicationInfo() ) ), 16, 36, 31 )
+ : '',
+ 'timestamp' => time() // UNIX timestamp
);
}
if ( $title ) {
$job = Job::factory( $fields['type'], $title, $fields['params'] );
$job->metadata['uuid'] = $fields['uuid'];
+
return $job;
}
+
return false;
}
protected function serialize( array $fields ) {
$blob = serialize( $fields );
if ( $this->compression === 'gzip'
- && strlen( $blob ) >= 1024 && function_exists( 'gzdeflate' ) )
- {
+ && strlen( $blob ) >= 1024
+ && function_exists( 'gzdeflate' )
+ ) {
$object = (object)array( 'blob' => gzdeflate( $blob ), 'enc' => 'gzip' );
$blobz = serialize( $object );
+
return ( strlen( $blobz ) < strlen( $blob ) ) ? $blobz : $blob;
} else {
return $blob;
$fields = false;
}
}
+
return is_array( $fields ) ? $fields : false;
}
if ( !$conn ) {
throw new JobQueueConnectionError( "Unable to connect to redis server." );
}
+
return $conn;
}
/**
* @param array $params
*/
- protected function __construct( array $params ) {}
+ protected function __construct( array $params ) {
+ }
/**
* @return JobQueueAggregator
wfProfileIn( __METHOD__ );
$ok = $this->doNotifyQueueEmpty( $wiki, $type );
wfProfileOut( __METHOD__ );
+
return $ok;
}
wfProfileIn( __METHOD__ );
$ok = $this->doNotifyQueueNonEmpty( $wiki, $type );
wfProfileOut( __METHOD__ );
+
return $ok;
}
wfProfileIn( __METHOD__ );
$res = $this->doGetAllReadyWikiQueues();
wfProfileOut( __METHOD__ );
+
return $res;
}
wfProfileIn( __METHOD__ );
$res = $this->doPurge();
wfProfileOut( __METHOD__ );
+
return $res;
}
}
$this->cache->delete( "$key:lock" ); // unlock
}
+
return true;
}
$this->cache->delete( "$key:rebuild" ); // unlock
}
}
+
return is_array( $pendingDbInfo )
? $pendingDbInfo['pendingDBs']
: array(); // cache is both empty and locked
}
try {
$conn->hDel( $this->getReadyQueueKey(), $this->encQueueName( $type, $wiki ) );
+
return true;
} catch ( RedisException $e ) {
$this->handleException( $conn, $e );
+
return false;
}
}
}
try {
$conn->hSet( $this->getReadyQueueKey(), $this->encQueueName( $type, $wiki ), time() );
+
return true;
} catch ( RedisException $e ) {
$this->handleException( $conn, $e );
+
return false;
}
}
return $pendingDBs;
} catch ( RedisException $e ) {
$this->handleException( $conn, $e );
+
return array();
}
}
$conn->delete( $this->getReadyQueueKey() );
} catch ( RedisException $e ) {
$this->handleException( $conn, $e );
+
return false;
}
+
return true;
}
break;
}
}
+
return $conn;
}
*/
private function dencQueueName( $name ) {
list( $type, $wiki ) = explode( '/', $name, 2 );
+
return array( rawurldecode( $type ), rawurldecode( $wiki ) );
}
}
$user = $context->getUser();
if ( !$user->isLoggedIn() ) {
$this->setLastError( "Could not load the author user from session." );
+
return false;
}
// the user does not necessarily mean the session was loaded.
// Most likely cause by suhosin.session.encrypt = On.
$this->setLastError( "Error associating with user session. Try setting suhosin.session.encrypt = Off" );
+
return false;
}
array( 'result' => 'Failure', 'stage' => 'assembling', 'status' => $status )
);
$this->setLastError( $status->getWikiText() );
+
return false;
}
)
);
$this->setLastError( get_class( $e ) . ": " . $e->getText() );
+
return false;
}
+
return true;
}
if ( is_array( $info['params'] ) ) {
$info['params'] = array( 'filekey' => $info['params']['filekey'] );
}
+
return $info;
}
function run() {
if ( !$this->redirTitle ) {
$this->setLastError( 'Invalid title' );
+
return false;
}
$targetRev = Revision::newFromTitle( $this->title, false, Revision::READ_LATEST );
if ( !$targetRev ) {
wfDebug( __METHOD__ . ": target redirect already deleted, ignoring\n" );
+
return true;
}
$content = $targetRev->getContent();
$currentDest = $content ? $content->getRedirectTarget() : null;
if ( !$currentDest || !$currentDest->equals( $this->redirTitle ) ) {
wfDebug( __METHOD__ . ": Redirect has changed since the job was queued\n" );
+
return true;
}
$mw = MagicWord::get( 'staticredirect' );
if ( $content->matchMagicWord( $mw ) ) {
wfDebug( __METHOD__ . ": skipping: suppressed with __STATICREDIRECT__\n" );
+
return true;
}
$newTitle = self::getFinalDestination( $this->redirTitle );
if ( !$newTitle ) {
wfDebug( __METHOD__ . ": skipping: single redirect, circular redirect or invalid redirect destination\n" );
+
return true;
}
if ( $newTitle->equals( $this->redirTitle ) ) {
if ( $newContent->equals( $content ) ) {
$this->setLastError( 'Content unchanged???' );
+
return false;
}
$user = $this->getUser();
if ( !$user ) {
$this->setLastError( 'Invalid user' );
+
return false;
}
$titleText = $title->getPrefixedDBkey();
if ( isset( $seenTitles[$titleText] ) ) {
wfDebug( __METHOD__, "Circular redirect detected, aborting\n" );
+
return false;
}
$seenTitles[$titleText] = true;
$dest = $title = Title::makeTitle( $row->rd_namespace, $row->rd_title, '', $row->rd_interwiki );
}
}
+
return $dest;
}
self::$user->addToDatabase();
}
}
+
return self::$user;
}
}
$djob->params = is_array( $djob->params ) ? $djob->params : array();
$djob->params = array( 'isDuplicate' => true ) + $djob->params;
$djob->metadata = $job->metadata;
+
return $djob;
}
return $status->isOK();
}
-
}
* @ingroup JobQueue
*/
class EnotifNotifyJob extends Job {
-
function __construct( $title, $params, $id = 0 ) {
parent::__construct( 'enotifNotify', $title, $params, $id );
}
$this->params['watchers'],
$this->params['pageStatus']
);
+
return true;
}
-
}
$numRows = $this->blCache->getNumLinks( $this->params['table'], $max );
if ( $wgMaxBacklinksInvalidate !== false && $numRows > $wgMaxBacklinksInvalidate ) {
wfDebug( "Skipped HTML cache invalidation of {$this->title->getPrefixedText()}." );
+
return true;
}
# period of time, say by updating a heavily-used template.
$this->insertJobsFromTitles( $titleArray );
}
+
return true;
}
$job = new self( $this->title, $params );
JobQueueGroup::singleton()->push( $job );
}
+
return true;
}
}
$user = $context->getUser();
if ( !$user->isLoggedIn() ) {
$this->setLastError( "Could not load the author user from session." );
+
return false;
}
// the user does not necessarily mean the session was loaded.
// Most likely cause by suhosin.session.encrypt = On.
$this->setLastError( "Error associating with user session. Try setting suhosin.session.encrypt = Off" );
+
return false;
}
array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status )
);
$this->setLastError( "Could not verify upload." );
+
return false;
}
array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status )
);
$this->setLastError( $status->getWikiText() );
+
return false;
}
)
);
$this->setLastError( get_class( $e ) . ": " . $e->getText() );
+
return false;
}
+
return true;
}
if ( is_array( $info['params'] ) ) {
$info['params'] = array( 'filekey' => $info['params']['filekey'] );
}
+
return $info;
}
if ( is_null( $this->title ) ) {
$this->error = "refreshLinks: Invalid title";
+
return false;
}
if ( !$revision ) {
$this->error = 'refreshLinks: Article not found "' .
$this->title->getPrefixedDBkey() . '"';
+
return false; // XXX: what if it was just deleted?
}
if ( is_array( $info['params'] ) ) {
unset( $info['params']['masterPos'] );
}
+
return $info;
}
if ( is_null( $this->title ) ) {
$this->error = "refreshLinks2: Invalid title";
+
return false;
}
array( 'masterPos' => $masterPos ) + $this->getRootJobParams()
); // carry over information for de-duplication
}
+
return $jobs;
}
if ( is_array( $info['params'] ) ) {
unset( $info['params']['masterPos'] );
}
+
return $info;
}
}
$status = $this->upload->fetchFile( $opts );
if ( !$status->isOk() ) {
$this->leaveMessage( $status );
+
return true;
}
if ( $result['status'] != UploadBase::OK ) {
$status = $this->upload->convertVerifyErrorToStatus( $result );
$this->leaveMessage( $status );
+
return true;
}
$this->user
);
$this->leaveMessage( $status );
- return true;
+ return true;
}
/**
if ( !isset( $_SESSION[self::SESSION_KEYNAME][$key] ) ) {
$_SESSION[self::SESSION_KEYNAME][$key] = array();
}
+
return $_SESSION[self::SESSION_KEYNAME][$key];
}
}