Support » Plugin: MemcacheD Is Your Friend » PHP7 constructor and fix for some noticed

  • memcache-class-object-cache.php line #415

    function __construct() {
    		global $memcached_servers;
    
    		if ( isset( $memcached_servers ) ) {
    			$buckets = $memcached_servers;
    		} else {
    			$buckets = array( '127.0.0.1' );
    		}
    
    		reset( $buckets );
    		if ( is_int( key( $buckets ) ) ) {
    			$buckets = array( 'default' => $buckets );
    		}
    
    		foreach ( $buckets as $bucket => $servers ) {
    			$this->mc[ $bucket ] = new Memcache();
    			foreach ( $servers as $server ) {
                                    #strpos if server is wihout port
    				if(strpos($server, ':') !== false) {
    					list ( $node, $port ) = explode( ':', $server );
    				} else {
    					$node = $server;
    				}
    				if ( empty($port) ) {
    					$port = ini_get( 'memcache.default_port' );
    				}
    				$port = intval( $port );

    https://wordpress.org/plugins/memcached-is-your-friend/

  • The topic ‘PHP7 constructor and fix for some noticed’ is closed to new replies.