1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/ServiceProvider/ClassProvider.php

90 lines
2.1 KiB
PHP
Raw Normal View History

2015-01-16 14:23:05 +01:00
<?php
namespace ServiceProvider;
2015-02-25 17:29:06 +01:00
use Core\Paginator;
2015-01-16 14:23:05 +01:00
use Model\Config;
use Model\Project;
use Model\Webhook;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
class ClassProvider implements ServiceProviderInterface
{
private $classes = array(
'Model' => array(
'Acl',
'Action',
'Authentication',
'Board',
'Category',
'Color',
'Comment',
'Config',
'DateParser',
'File',
'LastLogin',
2015-02-25 17:29:06 +01:00
'Link',
2015-01-16 14:23:05 +01:00
'Notification',
'Project',
'ProjectActivity',
'ProjectAnalytic',
2015-02-25 17:29:06 +01:00
'ProjectDuplication',
2015-01-16 14:23:05 +01:00
'ProjectDailySummary',
'ProjectPermission',
2015-02-25 17:29:06 +01:00
'Subtask',
2015-01-16 14:23:05 +01:00
'SubtaskExport',
2015-02-25 17:29:06 +01:00
'SubtaskTimeTracking',
2015-01-16 14:23:05 +01:00
'Swimlane',
'Task',
'TaskCreation',
'TaskDuplication',
'TaskExport',
'TaskFinder',
2015-02-25 17:29:06 +01:00
'TaskFilter',
'TaskLink',
2015-01-16 14:23:05 +01:00
'TaskModification',
'TaskPermission',
'TaskPosition',
'TaskStatus',
'TaskValidator',
'TimeTracking',
'User',
'UserSession',
'Webhook',
),
'Core' => array(
2015-02-25 17:29:06 +01:00
'Helper',
2015-01-16 14:23:05 +01:00
'Template',
'Session',
'MemoryCache',
'FileCache',
2015-02-25 17:29:06 +01:00
'Request',
2015-01-16 14:23:05 +01:00
),
'Integration' => array(
'GitlabWebhook',
'GithubWebhook',
2015-02-25 17:29:06 +01:00
'BitbucketWebhook',
2015-01-16 14:23:05 +01:00
)
);
public function register(Container $container)
{
foreach ($this->classes as $namespace => $classes) {
foreach ($classes as $name) {
$class = '\\'.$namespace.'\\'.$name;
$container[lcfirst($name)] = function ($c) use ($class) {
return new $class($c);
};
}
}
2015-02-25 17:29:06 +01:00
$container['paginator'] = $container->factory(function ($c) {
return new Paginator($c);
});
2015-01-16 14:23:05 +01:00
}
}