mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00

Conflicts: lib/Alchemy/Phrasea/Command/Developer/JavascriptBuilder.php lib/Alchemy/Phrasea/Controller/Prod/Basket.php lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php lib/classes/Exception/Feed/ItemNotFound.php lib/classes/Exception/Feed/PublisherNotFound.php lib/classes/Feed/Abstract.php lib/classes/Feed/Adapter.php lib/classes/Feed/Aggregate.php lib/classes/Feed/Collection.php lib/classes/Feed/CollectionInterface.php lib/classes/Feed/Entry/Adapter.php lib/classes/Feed/Entry/Collection.php lib/classes/Feed/Entry/Interface.php lib/classes/Feed/Entry/Item.php lib/classes/Feed/Entry/ItemInterface.php lib/classes/Feed/Interface.php lib/classes/Feed/Link.php lib/classes/Feed/LinkInterface.php lib/classes/Feed/Publisher/Adapter.php lib/classes/Feed/Publisher/Interface.php lib/classes/Feed/Token.php lib/classes/Feed/TokenAggregate.php lib/classes/Feed/XML/Abstract.php lib/classes/Feed/XML/Atom.php lib/classes/Feed/XML/Cooliris.php lib/classes/Feed/XML/Interface.php lib/classes/Feed/XML/RSS.php lib/classes/Feed/XML/RSS/ImageInterface.php lib/classes/http/request.php lib/classes/module/console/schedulerStart.php lib/classes/module/console/schedulerState.php lib/classes/module/console/schedulerStop.php lib/classes/module/console/taskState.php lib/classes/module/console/tasklist.php lib/classes/module/console/taskrun.php lib/classes/registry.php lib/classes/registryInterface.php lib/classes/set/order.php lib/classes/system/url.php lib/classes/task/Scheduler.php lib/classes/task/appboxAbstract.php lib/classes/task/databoxAbstract.php lib/classes/task/manager.php lib/classes/task/period/RecordMover.php lib/classes/task/period/apibridge.php lib/classes/task/period/archive.php lib/classes/task/period/cindexer.php lib/classes/task/period/emptyColl.php lib/classes/task/period/ftp.php lib/classes/task/period/ftpPull.php lib/classes/task/period/subdef.php lib/classes/task/period/test.php lib/classes/task/period/writemeta.php lib/conf.d/PhraseaFixture/AbstractWZ.php lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php lib/conf.d/PhraseaFixture/Lazaret/LoadOneFile.php lib/conf.d/PhraseaFixture/Story/LoadOneStory.php lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php lib/conf.d/PhraseaFixture/UsrLists/UsrList.php lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php
105 lines
3.7 KiB
PHP
105 lines
3.7 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\Core\CLIProvider;
|
|
|
|
use Alchemy\Phrasea\Command\Developer\Utils\BowerDriver;
|
|
use Alchemy\Phrasea\Command\Developer\Utils\ComposerDriver;
|
|
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
|
|
use Alchemy\Phrasea\Command\Developer\Utils\RecessDriver;
|
|
use Alchemy\Phrasea\Command\Developer\Utils\UglifyJsDriver;
|
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
|
use Silex\Application;
|
|
use Silex\ServiceProviderInterface;
|
|
use Symfony\Component\Process\ExecutableFinder;
|
|
|
|
class CLIDriversServiceProvider implements ServiceProviderInterface
|
|
{
|
|
public function register(Application $app)
|
|
{
|
|
$app['executable-finder'] = $app->share(function () {
|
|
return new ExecutableFinder();
|
|
});
|
|
|
|
$app['driver.binary-finder'] = $app->protect(function ($name, $configName) use ($app) {
|
|
$extraDirs = [];
|
|
|
|
if (is_dir($app['root.path'] . '/node_modules')) {
|
|
$extraDirs[] = $app['root.path'] . '/node_modules/.bin';
|
|
}
|
|
|
|
if (!$app['configuration.store']->isSetup()) {
|
|
return $app['executable-finder']->find($name, null, $extraDirs);
|
|
}
|
|
|
|
if ($app['conf']->has(['main', 'binaries', $configName])) {
|
|
return $app['conf']->get(['main', 'binaries', $configName]);
|
|
}
|
|
|
|
return $app['executable-finder']->find($name, null, $extraDirs);
|
|
});
|
|
|
|
$app['driver.bower'] = $app->share(function (Application $app) {
|
|
$bowerBinary = $app['driver.binary-finder']('bower', 'bower_binary');
|
|
|
|
if (null === $bowerBinary) {
|
|
throw new RuntimeException('Unable to find bower executable.');
|
|
}
|
|
|
|
return BowerDriver::create(['bower.binaries' => $bowerBinary, 'timeout' => 300], $app['monolog']);
|
|
});
|
|
|
|
$app['driver.recess'] = $app->share(function (Application $app) {
|
|
$recessBinary = $app['driver.binary-finder']('recess', 'recess_binary');
|
|
|
|
if (null === $recessBinary) {
|
|
throw new RuntimeException('Unable to find recess executable.');
|
|
}
|
|
|
|
return RecessDriver::create(['recess.binaries' => $recessBinary], $app['monolog']);
|
|
});
|
|
|
|
$app['driver.composer'] = $app->share(function (Application $app) {
|
|
$composerBinary = $app['driver.binary-finder']('composer', 'composer_binary');
|
|
|
|
if (null === $composerBinary) {
|
|
throw new RuntimeException('Unable to find composer executable.');
|
|
}
|
|
|
|
return ComposerDriver::create(['composer.binaries' => $composerBinary, 'timeout' => 300], $app['monolog']);
|
|
});
|
|
|
|
$app['driver.uglifyjs'] = $app->share(function (Application $app) {
|
|
$uglifyJsBinary = $app['driver.binary-finder']('uglifyjs', 'uglifyjs_binary');
|
|
|
|
if (null === $uglifyJsBinary) {
|
|
throw new RuntimeException('Unable to find uglifyJs executable.');
|
|
}
|
|
|
|
return UglifyJsDriver::create(['uglifyjs.binaries' => $uglifyJsBinary], $app['monolog']);
|
|
});
|
|
|
|
$app['driver.grunt'] = $app->share(function (Application $app) {
|
|
$gruntBinary = $app['driver.binary-finder']('grunt', 'grunt_binary');
|
|
|
|
if (null === $gruntBinary) {
|
|
throw new RuntimeException('Unable to find grunt executable.');
|
|
}
|
|
|
|
return GruntDriver::create(['grunt.binaries' => $gruntBinary], $app['monolog']);
|
|
});
|
|
}
|
|
|
|
public function boot(Application $app)
|
|
{
|
|
}
|
|
}
|