From: Sam Reed Date: Wed, 17 Aug 2011 17:11:49 +0000 (+0000) Subject: Documentation X-Git-Tag: 1.31.0-rc.0~28209 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=ca37487a99b275dda11e4caa4aafdf6436645efc;p=lhc%2Fweb%2Fwiklou.git Documentation Trim trailing whitespace --- diff --git a/includes/PoolCounter.php b/includes/PoolCounter.php index 182520e1c9..83ae0abea0 100644 --- a/includes/PoolCounter.php +++ b/includes/PoolCounter.php @@ -1,11 +1,11 @@ key = $key; $this->workers = $conf['workers']; @@ -125,7 +125,7 @@ class PoolCounter_Stub extends PoolCounter { */ abstract class PoolCounterWork { protected $cacheable = false; //Does this override getCachedWork() ? - + /** * Actually perform the work, caching it if needed. */ @@ -140,30 +140,34 @@ abstract class PoolCounterWork { } /** - * A work not so good (eg. expired one) but better than an error + * A work not so good (eg. expired one) but better than an error * message. * @return mixed work result or false */ function fallback() { return false; } - + /** * Do something with the error, like showing it to the user. */ - function error( $status ) { + function error( $status ) { return false; } /** * Log an error + * + * @param $status Status */ function logError( $status ) { wfDebugLog( 'poolcounter', $status->getWikiText() ); } - + /** * Get the result of the work (whatever it is), or false. + * @param $skipcache bool + * @return bool|mixed */ function execute( $skipcache = false ) { if ( $this->cacheable && !$skipcache ) { @@ -183,7 +187,7 @@ abstract class PoolCounterWork { $result = $this->doWork(); $this->poolCounter->release(); return $result; - + case PoolCounter::DONE: $result = $this->getCachedWork(); if ( $result === false ) { @@ -193,27 +197,27 @@ abstract class PoolCounterWork { return $this->execute( true ); } return $result; - + case PoolCounter::QUEUE_FULL: case PoolCounter::TIMEOUT: $result = $this->fallback(); - + if ( $result !== false ) { return $result; } /* no break */ - + /* These two cases should never be hit... */ case PoolCounter::ERROR: default: $errors = array( PoolCounter::QUEUE_FULL => 'pool-queuefull', PoolCounter::TIMEOUT => 'pool-timeout' ); - - $status = Status::newFatal( isset($errors[$status->value]) ? $errors[$status->value] : 'pool-errorunknown' ); + + $status = Status::newFatal( isset( $errors[$status->value] ) ? $errors[$status->value] : 'pool-errorunknown' ); $this->logError( $status ); return $this->error( $status ); } } - + function __construct( $type, $key ) { $this->poolCounter = PoolCounter::factory( $type, $key ); }