mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 20:13:28 +00:00
66 lines
2.2 KiB
PHP
66 lines
2.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2013 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Alchemy\Phrasea\Core\Provider;
|
|
|
|
use Alchemy\Phrasea\TaskManager\Job\FtpJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\ArchiveJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\BridgeJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\FtpPullJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\PhraseanetIndexerJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\RecordMoverJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\SubdefsJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\WriteMetadataJob;
|
|
use Alchemy\Phrasea\TaskManager\Job\Factory as JobFactory;
|
|
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
|
use Alchemy\Phrasea\TaskManager\Log\LogFileFactory;
|
|
use Silex\Application;
|
|
use Silex\ServiceProviderInterface;
|
|
|
|
class TasksServiceProvider implements ServiceProviderInterface
|
|
{
|
|
public function register(Application $app)
|
|
{
|
|
$app['task-manager.job-factory'] = $app->share(function(Application $app) {
|
|
return new JobFactory($app['dispatcher'],isset($app['task-manager.logger']) ? $app['task-manager.logger'] : $app['logger']);
|
|
});
|
|
|
|
$app['task-manager.status'] = $app->share(function(Application $app) {
|
|
return new TaskManagerStatus($app['phraseanet.configuration']);
|
|
});
|
|
|
|
$app['task-manager.log-file.root'] = $app->share(function (Application $app) {
|
|
return $app['root.path'].'/logs';
|
|
});
|
|
|
|
$app['task-manager.log-file.factory'] = $app->share(function(Application $app) {
|
|
return new LogFileFactory($app['task-manager.log-file.root']);
|
|
});
|
|
|
|
$app['task-manager.available-jobs'] = $app->share(function(Application $app) {
|
|
return array(
|
|
new FtpJob(),
|
|
new ArchiveJob(),
|
|
new BridgeJob(),
|
|
new FtpPullJob(),
|
|
new PhraseanetIndexerJob(),
|
|
new RecordMoverJob(),
|
|
new SubdefsJob(),
|
|
new WriteMetadataJob(),
|
|
);
|
|
});
|
|
}
|
|
|
|
public function boot(Application $app)
|
|
{
|
|
}
|
|
}
|