src/Zicht/Bundle/FrameworkExtraBundle/DependencyInjection/ZichtFrameworkExtraExtension.php
public function addUglifyConfiguration($uglifyConfigFile, $isDebug, ContainerBuilder $container)
    {
        if (!is_file($uglifyConfigFile)) {
            throw new InvalidConfigurationException(
                "zicht_framework_extra.uglify setting '$uglifyConfigFile' is not a file"
            );
        }

        $container->addResource(new FileResource($uglifyConfigFile));

        try {
            $uglifyConfig = Yaml::parse(file_get_contents($uglifyConfigFile));
        } catch (\Exception $e) {
            throw new InvalidConfigurationException(
                "zicht_framework_extra.uglify setting '$uglifyConfigFile' could not be read",
                0,
                $e
            );
        }

        $global = new Definition(
            'Zicht\Bundle\FrameworkExtraBundle\Twig\UglifyGlobal',
            array(
                $uglifyConfig,
                $isDebug
            )
        );

        $global->addTag('twig.global');
        $global->addMethodCall('setDebug', array($isDebug));
        $container->getDefinition('zicht_twig_extension')->addMethodCall('setGlobal', array('zicht_uglify', $global));
    }
public function addUglifyConfiguration($uglifyConfigFile, $isDebug, ContainerBuilder $container)
    {
        if (!is_file($uglifyConfigFile)) {
            throw new InvalidConfigurationException(
                "zicht_framework_extra.uglify setting '$uglifyConfigFile' is not a file"
            );
        }

        $container->addResource(new FileResource($uglifyConfigFile));

        try {
            $uglifyConfig = Yaml::parse(file_get_contents($uglifyConfigFile));
        } catch (\Exception $e) {
            throw new InvalidConfigurationException(
                "zicht_framework_extra.uglify setting '$uglifyConfigFile' could not be read",
                0,
                $e
            );
        }

        $global = new Definition(
            'Zicht\Bundle\FrameworkExtraBundle\Twig\UglifyGlobal',
            array(
                $uglifyConfig,
                $isDebug
            )
        );

        $global->addTag('twig.global');
        $global->addMethodCall('setDebug', array($isDebug));
        $container->getDefinition('zicht_twig_extension')->addMethodCall('setGlobal', array('zicht_uglify', $global));
    }
public function addUglifyConfiguration ( $ uglifyConfigFile , $ isDebug , ContainerBuilder $ container ) { if ( ! is_file ( $ uglifyConfigFile ) ) { throw new InvalidConfigurationException ( "zicht_framework_extra.uglify setting '$uglifyConfigFile' is not a file" ) ; } $ container -> addResource ( new FileResource ( $ uglifyConfigFile ) ) ; try { $ uglifyConfig = Yaml :: parse ( file_get_contents ( $ uglifyConfigFile ) ) ; } catch ( \ Exception $ e ) { throw new InvalidConfigurationException ( "zicht_framework_extra.uglify setting '$uglifyConfigFile' could not be read" , 0 , $ e ) ; } $ global = new Definition ( 'Zicht\Bundle\FrameworkExtraBundle\Twig\UglifyGlobal' , array ( $ uglifyConfig , $ isDebug ) ) ; $ global -> addTag ( 'twig.global' ) ; $ global -> addMethodCall ( 'setDebug' , array ( $ isDebug ) ) ; $ container -> getDefinition ( 'zicht_twig_extension' ) -> addMethodCall ( 'setGlobal' , array ( 'zicht_uglify' , $ global ) ) ; }
Adds the uglify configuration

@param string $uglifyConfigFile
@param boolean $isDebug
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@return void

@throws \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
Adds the uglify configuration