public function findAlias($class){

        $container = Container::open('aliases');

        if( $container->exists($class) ){
            $instance = $container->get($class);
            
            $config['provider'] = $instance;
            if( is_object($instance) ){
                 Container::open('instances')->add($class, $instance);
                 $config['provider'] = 'PlaceHolderClass';
            }
            $result = $this->createAlias($class, $config);
            return $result;
        }

        if( !isset($this->manifestResolver) ){
            $psr4 = require vibius_BASEPATH.'vendor/composer/autoload_psr4.php';
            $manifestResolver = new ManifestResolver($psr4);
            $this->manifestResolver = $manifestResolver;
            $manifestResolver->findManifests();
        }

        $manifestResolver = $this->manifestResolver;

        foreach ($manifestResolver->manifests as $manifestName => $manifestSrc) {
            $manifest = $manifestResolver->getManifest($manifestSrc);

            if( $manifestData = $manifestResolver->verifyManifest($manifest) ){

                foreach ($manifestData['components'] as $component => $componentConfig) {
                    if( $manifestResolver->verifyComponent($componentConfig) ){
                        if( $class === $componentConfig['alias'] ){
                            $componentSrc = explode('../manifest.php',$manifestSrc)[0];
                            $result = $this->createAlias($class, $componentConfig);
                            return $result;
                        }
                    }
                }

            }
            
        }
    }
public function findAlias($class){

        $container = Container::open('aliases');

        if( $container->exists($class) ){
            $instance = $container->get($class);
            
            $config['provider'] = $instance;
            if( is_object($instance) ){
                 Container::open('instances')->add($class, $instance);
                 $config['provider'] = 'PlaceHolderClass';
            }
            $result = $this->createAlias($class, $config);
            return $result;
        }

        if( !isset($this->manifestResolver) ){
            $psr4 = require vibius_BASEPATH.'vendor/composer/autoload_psr4.php';
            $manifestResolver = new ManifestResolver($psr4);
            $this->manifestResolver = $manifestResolver;
            $manifestResolver->findManifests();
        }

        $manifestResolver = $this->manifestResolver;

        foreach ($manifestResolver->manifests as $manifestName => $manifestSrc) {
            $manifest = $manifestResolver->getManifest($manifestSrc);

            if( $manifestData = $manifestResolver->verifyManifest($manifest) ){

                foreach ($manifestData['components'] as $component => $componentConfig) {
                    if( $manifestResolver->verifyComponent($componentConfig) ){
                        if( $class === $componentConfig['alias'] ){
                            $componentSrc = explode('../manifest.php',$manifestSrc)[0];
                            $result = $this->createAlias($class, $componentConfig);
                            return $result;
                        }
                    }
                }

            }
            
        }
    }
public function findAlias ( $ class ) { $ container = Container :: open ( 'aliases' ) ; if ( $ container -> exists ( $ class ) ) { $ instance = $ container -> get ( $ class ) ; $ config [ 'provider' ] = $ instance ; if ( is_object ( $ instance ) ) { Container :: open ( 'instances' ) -> add ( $ class , $ instance ) ; $ config [ 'provider' ] = 'PlaceHolderClass' ; } $ result = $ this -> createAlias ( $ class , $ config ) ; return $ result ; } if ( ! isset ( $ this -> manifestResolver ) ) { $ psr4 = require vibius_BASEPATH . 'vendor/composer/autoload_psr4.php' ; $ manifestResolver = new ManifestResolver ( $ psr4 ) ; $ this -> manifestResolver = $ manifestResolver ; $ manifestResolver -> findManifests ( ) ; } $ manifestResolver = $ this -> manifestResolver ; foreach ( $ manifestResolver -> manifests as $ manifestName => $ manifestSrc ) { $ manifest = $ manifestResolver -> getManifest ( $ manifestSrc ) ; if ( $ manifestData = $ manifestResolver -> verifyManifest ( $ manifest ) ) { foreach ( $ manifestData [ 'components' ] as $ component => $ componentConfig ) { if ( $ manifestResolver -> verifyComponent ( $ componentConfig ) ) { if ( $ class === $ componentConfig [ 'alias' ] ) { $ componentSrc = explode ( '../manifest.php' , $ manifestSrc ) [ 0 ] ; $ result = $ this -> createAlias ( $ class , $ componentConfig ) ; return $ result ; } } } } } }
This method is used to find a component from composer's psr4, which serves requested alias.
@param string $class Name of the alias to be looked for in psr4 autoloading array.
@return boolean True if alias was found and created.
This method is used to find a component from composer s psr4 which serves requested alias .