* @ingroup Cache
*/
class ObjectCache {
- static $instances = array();
+ public static $instances = array();
/**
* Get a cached instance of the specified type of cache object.
$class = $params['class'];
return new $class( $params );
} else {
- throw new MWException( "The definition of cache type \"" . print_r( $params, true ) . "\" lacks both " .
- "factory and class parameters." );
+ throw new MWException( "The definition of cache type \""
+ . print_r( $params, true ) . "\" lacks both "
+ . "factory and class parameters." );
}
}
* @ingroup Cache
*/
class SqlBagOStuff extends BagOStuff {
- /**
- * @var LoadBalancer
- */
- var $lb;
+ /** @var LoadBalancer */
+ protected $lb;
+
+ protected $serverInfos;
+
+ /** @var array */
+ protected $serverNames;
+
+ /** @var int */
+ protected $numServers;
+
+ /** @var array */
+ protected $conns;
+
+ /** @var int */
+ protected $lastExpireAll = 0;
- var $serverInfos;
- var $serverNames;
- var $numServers;
- var $conns;
- var $lastExpireAll = 0;
- var $purgePeriod = 100;
- var $shards = 1;
- var $tableName = 'objectcache';
+ /** @var int */
+ protected $purgePeriod = 100;
- protected $connFailureTimes = array(); // UNIX timestamps
- protected $connFailureErrors = array(); // exceptions
+ /** @var int */
+ protected $shards = 1;
+
+ /** @var string */
+ protected $tableName = 'objectcache';
+
+ /** @var array UNIX timestamps */
+ protected $connFailureTimes = array();
+
+ /** @var array Exceptions */
+ protected $connFailureErrors = array();
/**
* Constructor. Parameters are:
if ( $exception->db && $exception->db->wasReadOnlyError() ) {
try {
$exception->db->rollback( __METHOD__ );
- } catch ( DBError $e ) {}
+ } catch ( DBError $e ) {
+ }
}
wfDebugLog( 'SQLBagOStuff', "DBError: {$exception->getMessage()}" );
if ( $exception instanceof DBConnectionError ) {
/**
* Backwards compatibility alias
*/
-class MediaWikiBagOStuff extends SqlBagOStuff { }
+class MediaWikiBagOStuff extends SqlBagOStuff {
+}