Created
November 21, 2013 19:48
-
-
Save yellow1912/7588335 to your computer and use it in GitHub Desktop.
just a short snippet to show an issue with pthreads on SF2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Symfony framework. | |
* | |
* (c) Fabien Potencier <fabien@symfony.com> | |
* | |
* This source file is subject to the MIT license that is bundled | |
* with this source code in the file LICENSE. | |
*/ | |
namespace My\AsseticBundle\Command; | |
use My\AsseticBundle\Cache\ImageCacheWarmer; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\ConsoleOutputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
/** | |
* Dumps assets to the filesystem. | |
* | |
* @author Kris Wallsmith <kris@symfony.com> | |
*/ | |
class DumpCommand extends ContainerAwareCommand | |
{ | |
private $cacheWarmer; | |
protected function configure() | |
{ | |
$this | |
->setName('assetic:dump-images') | |
->setDescription('Dumps all images to the filesystem'); | |
} | |
protected function execute(InputInterface $input, OutputInterface $stdout) | |
{ | |
// capture error output | |
$stderr = $stdout instanceof ConsoleOutputInterface | |
? $stdout->getErrorOutput() | |
: $stdout; | |
// print the header | |
$stdout->writeln('Dumping all images.'); | |
foreach ($this->getContainer()->get('My.manager.image')->findAll() as $image) { | |
$stdout->writeln(basename($image->getPath())); | |
$cacheWarmer = new ImageCacheWarmer(); | |
$cacheWarmer->start(); | |
} | |
$stdout->writeln(''); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment