Sulu\Bundle\MediaBundle\DependencyInjection\ImageFormatCompilerPass::setFormatsFromFile PHP Method

setFormatsFromFile() protected method

protected setFormatsFromFile ( $fullPath, &$activeFormats, $globalOptions )
$fullPath
$activeFormats
$globalOptions
    protected function setFormatsFromFile($fullPath, &$activeFormats, $globalOptions)
    {
        $folder = dirname($fullPath);
        $fileName = basename($fullPath);
        $locator = new FileLocator($folder);
        $xmlLoader10 = new XmlFormatLoader10($locator);
        $xmlLoader11 = new XmlFormatLoader11($locator);
        $xmlLoader10->setGlobalOptions($globalOptions);
        $xmlLoader11->setGlobalOptions($globalOptions);
        $resolver = new LoaderResolver([$xmlLoader10, $xmlLoader11]);
        $loader = new DelegatingLoader($resolver);
        $themeFormats = $loader->load($fileName);
        foreach ($themeFormats as $format) {
            $activeFormats[$format['key']] = $format;
        }
    }