diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-13 14:07:56 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-13 14:07:56 -0400 |
commit | a6a00a00400f164c4b18094999a5ed72366dd519 (patch) | |
tree | 7d2bfc3fe4a36649f9092463228f4553979aef94 /app/ServiceProvider/ClassProvider.php | |
parent | c405f99fc8b7420b3e69c633b3259756a1ceb2f2 (diff) |
First draft for plugins system
Diffstat (limited to 'app/ServiceProvider/ClassProvider.php')
-rw-r--r-- | app/ServiceProvider/ClassProvider.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index b570f5cf..53bddc1b 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -4,6 +4,7 @@ namespace ServiceProvider; use Core\Paginator; use Core\OAuth2; +use Core\Tool; use Model\Config; use Model\Project; use Model\Webhook; @@ -94,17 +95,7 @@ class ClassProvider implements ServiceProviderInterface 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); - }; - } - } + Tool::buildDIC($container, $this->classes); $container['paginator'] = $container->factory(function ($c) { return new Paginator($c); |