X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPoolCounter.php;h=85c4c79a34bb307db69f779b97eea883e08a63cf;hb=ceccc158847c173d5a1c2b388334268222832e4a;hp=b4f14c21d7500e902a14d5bcd6d1570078120f4c;hpb=e6e1c9d8e7e0742e5fda09b5c7ba4983fc14b2ed;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PoolCounter.php b/includes/PoolCounter.php index b4f14c21d7..85c4c79a34 100644 --- a/includes/PoolCounter.php +++ b/includes/PoolCounter.php @@ -91,6 +91,13 @@ abstract class PoolCounter { return new $class( $conf, $type, $key ); } + /** + * @return string + */ + public function getKey() { + return $this->key; + } + /** * I want to do this task and I need to do it myself. * @@ -175,7 +182,7 @@ abstract class PoolCounterWork { * Do something with the error, like showing it to the user. * @return bool */ - function error( $status ) { + public function error( $status ) { return false; } @@ -185,8 +192,10 @@ abstract class PoolCounterWork { * @param $status Status * @return void */ - function logError( $status ) { - wfDebugLog( 'poolcounter', "Pool key '{$this->key}':" + public function logError( $status ) { + $key = $this->poolCounter->getKey(); + + wfDebugLog( 'poolcounter', "Pool key '$key': " . $status->getMessage()->inLanguage( 'en' )->useDatabase( false )->text() ); } @@ -314,14 +323,14 @@ class PoolCounterWorkViaCallback extends PoolCounterWork { return false; } - function fallback() { + public function fallback() { if ( $this->fallback ) { return call_user_func_array( $this->fallback, array() ); } return false; } - function error( $status ) { + public function error( $status ) { if ( $this->error ) { return call_user_func_array( $this->error, array( $status ) ); }