*
* @param array $config
* @param string $backend A registered file backend name
- * @throws MWException
+ * @throws Exception
* @return FileJournal
*/
final public static function factory( array $config, $backend ) {
$class = $config['class'];
$jrn = new $class( $config );
if ( !$jrn instanceof self ) {
- throw new MWException( "Class given is not an instance of FileJournal." );
+ throw new Exception( "Class given is not an instance of FileJournal." );
}
$jrn->backend = $backend;
* Register an array of file lock manager configurations
*
* @param array $configs
- * @throws MWException
+ * @throws Exception
*/
protected function register( array $configs ) {
foreach ( $configs as $config ) {
$config['domain'] = $this->domain;
if ( !isset( $config['name'] ) ) {
- throw new MWException( "Cannot register a lock manager with no name." );
+ throw new Exception( "Cannot register a lock manager with no name." );
}
$name = $config['name'];
if ( !isset( $config['class'] ) ) {
- throw new MWException( "Cannot register lock manager `{$name}` with no class." );
+ throw new Exception( "Cannot register lock manager `{$name}` with no class." );
}
$class = $config['class'];
unset( $config['class'] ); // lock manager won't need this
*
* @param string $name
* @return LockManager
- * @throws MWException
+ * @throws Exception
*/
public function get( $name ) {
if ( !isset( $this->managers[$name] ) ) {
- throw new MWException( "No lock manager defined with the name `$name`." );
+ throw new Exception( "No lock manager defined with the name `$name`." );
}
// Lazy-load the actual lock manager instance
if ( !isset( $this->managers[$name]['instance'] ) ) {
*
* @param string $name
* @return array
- * @throws MWException
+ * @throws Exception
*/
public function config( $name ) {
if ( !isset( $this->managers[$name] ) ) {
- throw new MWException( "No lock manager defined with the name `$name`." );
+ throw new Exception( "No lock manager defined with the name `$name`." );
}
$class = $this->managers[$name]['class'];
* Throws an exception if no lock manager could be found.
*
* @return LockManager
- * @throws MWException
+ * @throws Exception
*/
public function getAny() {
return isset( $this->managers['default'] )
* each having an odd-numbered list of server names (peers) as values.
* - memcConfig : Configuration array for ObjectCache::newFromParams. [optional]
* If set, this must use one of the memcached classes.
- * @throws MWException
+ * @throws Exception
*/
public function __construct( array $config ) {
parent::__construct( $config );
if ( $cache instanceof MemcachedBagOStuff ) {
$this->bagOStuffs[$name] = $cache;
} else {
- throw new MWException(
+ throw new Exception(
'Only MemcachedBagOStuff classes are supported by MemcLockManager.' );
}
}
* - srvsByBucket : Array of 1-16 consecutive integer keys, starting from 0,
* each having an odd-numbered list of server names (peers) as values.
* - redisConfig : Configuration for RedisConnectionPool::__construct().
- * @throws MWException
+ * @throws Exception
*/
public function __construct( array $config ) {
parent::__construct( $config );