From: Aaron Schulz Date: Sat, 24 Oct 2015 22:06:24 +0000 (-0700) Subject: Remove some MW dependencies from RedisConnectionPool X-Git-Tag: 1.31.0-rc.0~9264^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=a506e7f09fd1f94b4385ff48cbde5672336fdbdc;p=lhc%2Fweb%2Fwiklou.git Remove some MW dependencies from RedisConnectionPool Change-Id: I41ee08d8c6df14ef5994ea8dd2ee61eb220941e3 --- diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 8a88fabbf0..64db0d6efb 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -79,11 +79,11 @@ class RedisConnectionPool implements LoggerAwareInterface { /** * @param array $options - * @throws MWException + * @throws Exception */ protected function __construct( array $options ) { if ( !class_exists( 'Redis' ) ) { - throw new MWException( __CLASS__ . ' requires a Redis client library. ' . + throw new Exception( __CLASS__ . ' requires a Redis client library. ' . 'See https://www.mediawiki.org/wiki/Redis#Setup' ); } if ( isset( $options['logger'] ) ) { @@ -102,7 +102,7 @@ class RedisConnectionPool implements LoggerAwareInterface { } elseif ( $options['serializer'] === 'none' ) { $this->serializer = Redis::SERIALIZER_NONE; } else { - throw new MWException( "Invalid serializer specified." ); + throw new InvalidArgumentException( "Invalid serializer specified." ); } } @@ -219,7 +219,9 @@ class RedisConnectionPool implements LoggerAwareInterface { // TCP connection $hostPort = IP::splitHostAndPort( $server ); if ( !$server || !$hostPort ) { - throw new MWException( __CLASS__ . ": invalid configured server \"$server\"" ); + throw new InvalidArgumentException( + __CLASS__ . ": invalid configured server \"$server\"" + ); } list( $host, $port ) = $hostPort; if ( $port === false ) {