Symfony\Bundle\AsseticBundle\Command\DumpCommand::doDump PHP Method

doDump() private method

Performs the asset dump.
private doDump ( Assetic\Asset\AssetInterface $asset, Symfony\Component\Console\Output\OutputInterface $output )
$asset Assetic\Asset\AssetInterface An asset
$output Symfony\Component\Console\Output\OutputInterface The command output
    private function doDump(AssetInterface $asset, OutputInterface $output)
    {
        $target = rtrim($this->basePath, '/').'/'.str_replace('_controller/', '', $asset->getTargetPath());
        if (!is_dir($dir = dirname($target))) {
            $output->writeln('<info>[dir+]</info> '.$dir);
            if (false === @mkdir($dir, 0777, true)) {
                throw new \RuntimeException('Unable to create directory '.$dir);
            }
        }

        $output->writeln('<info>[file+]</info> '.$target);
        if (false === @file_put_contents($target, $asset->dump())) {
            throw new \RuntimeException('Unable to write file '.$target);
        }
    }