public static function add($rediska)
    {
        if ($rediska instanceof Rediska) {
            if (!self::has($rediska->getName())) {
                foreach(self::$_instances as $name => $instance) {
                    if ($instance === $rediska && $name != $rediska->getName()) {
                        unset(self::$_instances[$name]);
                        break;
                    }
                }
            }
            $name = $rediska->getName();
        } else if (is_array($rediska)) {
            if (isset($rediska['name'])) {
                $name = $rediska['name'];
            } else {
                $name = Rediska::DEFAULT_NAME;
            }
        } else {
            throw new Rediska_Exception('Rediska must be a instance or options');
        }

        if (self::has($name)) {
            $result = false;
        } else {
            $result = true;
        }

        self::$_instances[$name] = $rediska;

        return $result;
    }
public static function add($rediska)
    {
        if ($rediska instanceof Rediska) {
            if (!self::has($rediska->getName())) {
                foreach(self::$_instances as $name => $instance) {
                    if ($instance === $rediska && $name != $rediska->getName()) {
                        unset(self::$_instances[$name]);
                        break;
                    }
                }
            }
            $name = $rediska->getName();
        } else if (is_array($rediska)) {
            if (isset($rediska['name'])) {
                $name = $rediska['name'];
            } else {
                $name = Rediska::DEFAULT_NAME;
            }
        } else {
            throw new Rediska_Exception('Rediska must be a instance or options');
        }

        if (self::has($name)) {
            $result = false;
        } else {
            $result = true;
        }

        self::$_instances[$name] = $rediska;

        return $result;
    }
public static function add ( $ rediska ) { if ( $ rediska instanceof Rediska ) { if ( ! self :: has ( $ rediska -> getName ( ) ) ) { foreach ( self :: $ _instances as $ name => $ instance ) { if ( $ instance === $ rediska && $ name != $ rediska -> getName ( ) ) { unset ( self :: $ _instances [ $ name ] ) ; break ; } } } $ name = $ rediska -> getName ( ) ; } else if ( is_array ( $ rediska ) ) { if ( isset ( $ rediska [ 'name' ] ) ) { $ name = $ rediska [ 'name' ] ; } else { $ name = Rediska :: DEFAULT_NAME ; } } else { throw new Rediska_Exception ( 'Rediska must be a instance or options' ) ; } if ( self :: has ( $ name ) ) { $ result = false ; } else { $ result = true ; } self :: $ _instances [ $ name ] = $ rediska ; return $ result ; }
Add Rediska
Return true if new instance and false if instance overwrited

@param Rediska $rediska Rediska instance or options
@return boolean
Add Rediska Return true if new instance and false if instance overwrited