magallanes/src/Task/BuiltIn/Symfony/AssetsInstallTask.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2016-12-31 07:52:25 +01:00
<?php
/*
* This file is part of the Magallanes package.
*
* (c) Andrés Montañez <andres@andresmontanez.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mage\Task\BuiltIn\Symfony;
use Symfony\Component\Process\Process;
/**
* Symfony Task - Install Assets
*
* @author Andrés Montañez <andresmontanez@gmail.com>
*/
2017-04-14 20:43:27 +02:00
class AssetsInstallTask extends AbstractSymfonyTask
2016-12-31 07:52:25 +01:00
{
public function getName()
{
return 'symfony/assets-install';
}
public function getDescription()
{
return '[Symfony] Assets Install';
}
public function execute()
{
$options = $this->getOptions();
$command = sprintf('%s assets:install %s --env=%s %s', $options['console'], $options['target'], $options['env'], $options['flags']);
2016-12-31 07:52:25 +01:00
/** @var Process $process */
$process = $this->runtime->runCommand(trim($command));
2016-12-31 07:52:25 +01:00
return $process->isSuccessful();
}
2017-04-14 20:43:27 +02:00
protected function getSymfonyOptions()
2016-12-31 07:52:25 +01:00
{
2017-04-14 20:43:27 +02:00
return ['target' => 'web', 'flags' => '--symlink --relative'];
2016-12-31 07:52:25 +01:00
}
}