changed memcached server parsing to allow for local unix domain socket connections
authorJoel Natividad <joel.natividad@ontodia.com>
Mon, 30 Dec 2013 20:58:24 +0000 (15:58 -0500)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 31 Dec 2013 19:10:53 +0000 (11:10 -0800)
* This works with local memcached (e.g. unix:///var/run/memcached/memcached.sock:0 )
  and noticeably increases memcached mediawiki performance

Change-Id: Ie08c151caa09eb0a4269df88965d71c2367c398b

includes/objectcache/MemcachedClient.php

index f0a9128..79c5187 100644 (file)
@@ -729,7 +729,7 @@ class MWMemcached {
         * @access  private
         */
        function _connect_sock( &$sock, $host ) {
-               list( $ip, $port ) = explode( ':', $host );
+               list( $ip, $port ) = preg_split('/:(?=\d)/' , $host );
                $sock = false;
                $timeout = $this->_connect_timeout;
                $errno = $errstr = null;