src/Container.php
public static function open($key, $private = false, $secure = false){

        if( !isset(self::$privates[$key]) && ($private === true) ){
            self::$privates[$key] = new Container;
            self::$privates[$key]->name = $key;
            self::$privates[$key]->secure = false;
            if($secure){
                self::$privates[$key]->secure = true;
            }
            return self::$privates[$key];
        }

        if( !isset(self::$instance[$key]) && ($private === false) ){
            self::$instance[$key] = new Container;
            self::$instance[$key]->name = $key;
            self::$instance[$key]->secure = false;
            if($secure){
                self::$instance[$key]->secure = true;
            }

            return self::$instance[$key];
        }else if( $private === false ){
            return self::$instance[$key];
        }

        throw new Exception("Container instance cannot be opened!");
    }
public static function open($key, $private = false, $secure = false){

        if( !isset(self::$privates[$key]) && ($private === true) ){
            self::$privates[$key] = new Container;
            self::$privates[$key]->name = $key;
            self::$privates[$key]->secure = false;
            if($secure){
                self::$privates[$key]->secure = true;
            }
            return self::$privates[$key];
        }

        if( !isset(self::$instance[$key]) && ($private === false) ){
            self::$instance[$key] = new Container;
            self::$instance[$key]->name = $key;
            self::$instance[$key]->secure = false;
            if($secure){
                self::$instance[$key]->secure = true;
            }

            return self::$instance[$key];
        }else if( $private === false ){
            return self::$instance[$key];
        }

        throw new Exception("Container instance cannot be opened!");
    }
public static function open ( $ key , $ private = false , $ secure = false ) { if ( ! isset ( self :: $ privates [ $ key ] ) && ( $ private === true ) ) { self :: $ privates [ $ key ] = new Container ; self :: $ privates [ $ key ] -> name = $ key ; self :: $ privates [ $ key ] -> secure = false ; if ( $ secure ) { self :: $ privates [ $ key ] -> secure = true ; } return self :: $ privates [ $ key ] ; } if ( ! isset ( self :: $ instance [ $ key ] ) && ( $ private === false ) ) { self :: $ instance [ $ key ] = new Container ; self :: $ instance [ $ key ] -> name = $ key ; self :: $ instance [ $ key ] -> secure = false ; if ( $ secure ) { self :: $ instance [ $ key ] -> secure = true ; } return self :: $ instance [ $ key ] ; } else if ( $ private === false ) { return self :: $ instance [ $ key ] ; } throw new Exception ( "Container instance cannot be opened!" ) ; }
Method is used to open specific instance of container.
@param string $key Identifier for inner storage to find the proper instance to open or create.
@return object Instance of Container class picked by $key.
Method is used to open specific instance of container .