Files
Phraseanet/lib/Alchemy/Phrasea/Command/Developer/Utils/GruntDriver.php

49 lines
1.2 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer\Utils;
use Alchemy\BinaryDriver\AbstractBinary;
use Alchemy\BinaryDriver\Configuration;
use Alchemy\BinaryDriver\ConfigurationInterface;
use Psr\Log\LoggerInterface;
class GruntDriver extends AbstractBinary
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'grunt';
}
/**
* @param array|ConfigurationInterface $conf
* @param LoggerInterface $logger
*
* @return GruntDriver
*/
public static function create($conf = [], LoggerInterface $logger = null)
{
if (!$conf instanceof ConfigurationInterface) {
$conf = new Configuration($conf);
}
$binaries = $conf->get('grunt.binaries', ['grunt']);
$driver = static::load($binaries, $logger, $conf);
$driver->getProcessBuilderFactory()->getBuilder()->setWorkingDirectory(__DIR__.'/../../../../../..');
return $driver;
}
}