public function loadFromFile($path)
    {
        // the file should exists
        $fileSystem = new Filesystem();

        if (!$fileSystem->exists($path)) {
            throw new FileNotFoundException();
        }
        // the file should be a yml file
        $configurationFile = new SplFileInfo($path);

        if ($configurationFile->getExtension() !== 'yml') {
            throw new Exception('Only yml are allowed for assets configuration loading');
        }
        // parse configuration using Symfony processor
        $configuration = Yaml::parse(file_get_contents($path));
        $configurationDI = new Configuration();
        $processor = new Processor();

        return $processor->processConfiguration($configurationDI, $configuration);
    }
public function loadFromFile($path)
    {
        // the file should exists
        $fileSystem = new Filesystem();

        if (!$fileSystem->exists($path)) {
            throw new FileNotFoundException();
        }
        // the file should be a yml file
        $configurationFile = new SplFileInfo($path);

        if ($configurationFile->getExtension() !== 'yml') {
            throw new Exception('Only yml are allowed for assets configuration loading');
        }
        // parse configuration using Symfony processor
        $configuration = Yaml::parse(file_get_contents($path));
        $configurationDI = new Configuration();
        $processor = new Processor();

        return $processor->processConfiguration($configurationDI, $configuration);
    }
public function loadFromFile ( $ path ) { // the file should exists $ fileSystem = new Filesystem ( ) ; if ( ! $ fileSystem -> exists ( $ path ) ) { throw new FileNotFoundException ( ) ; } // the file should be a yml file $ configurationFile = new SplFileInfo ( $ path ) ; if ( $ configurationFile -> getExtension ( ) !== 'yml' ) { throw new Exception ( 'Only yml are allowed for assets configuration loading' ) ; } // parse configuration using Symfony processor $ configuration = Yaml :: parse ( file_get_contents ( $ path ) ) ; $ configurationDI = new Configuration ( ) ; $ processor = new Processor ( ) ; return $ processor -> processConfiguration ( $ configurationDI , $ configuration ) ; }
Load the configuration from a yaml file in the file system.

@param string $path

@return array

@throws Exception
Load the configuration from a yaml file in the file system .