for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Anomaly\Streams\Platform\Asset\Console;
use Anomaly\Streams\Platform\Application\Application;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
/**
* Class Clear
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
*/
class Clear extends Command
{
* The console command name.
* @var string
protected $name = 'assets:clear';
* The console command description.
protected $description = 'Clear compiled public assets.';
* Execute the console command.
* @param Filesystem $files
* @param Application $application
public function fire(Filesystem $files, Application $application)
$directory = 'assets';
if ($path = $this->argument('path')) {
$directory .= DIRECTORY_SEPARATOR . str_replace('../', '', $path);
}
$files->deleteDirectory($directory = $application->getAssetsPath($directory), true);
$this->info($directory . ' has been emptied!');
* Get the console command arguments.
* @return array
protected function getArguments()
return [
['path', InputArgument::OPTIONAL, 'The asset path to delete.'],
];