diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-09 15:09:54 -0800 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-09 15:09:54 -0800 |
commit | 44aa24bab16bdc2545b08594386adb24ead3aa9e (patch) | |
tree | 4ca2c4632d9657f8babfb7781b5aadc0d3e30238 /app/ServiceProvider | |
parent | 95b2a36886a763242e11b4b27998a0d5c51ca7f4 (diff) |
Add user backend provider system
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r-- | app/ServiceProvider/GroupProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/UserProvider.php | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/app/ServiceProvider/GroupProvider.php b/app/ServiceProvider/GroupProvider.php index 08548c73..86f5d112 100644 --- a/app/ServiceProvider/GroupProvider.php +++ b/app/ServiceProvider/GroupProvider.php @@ -25,7 +25,7 @@ class GroupProvider implements ServiceProviderInterface */ public function register(Container $container) { - $container['groupManager'] = new GroupManager; + $container['groupManager'] = new GroupManager(); if (DB_GROUP_PROVIDER) { $container['groupManager']->register(new DatabaseBackendGroupProvider($container)); diff --git a/app/ServiceProvider/UserProvider.php b/app/ServiceProvider/UserProvider.php new file mode 100644 index 00000000..c80a2aeb --- /dev/null +++ b/app/ServiceProvider/UserProvider.php @@ -0,0 +1,35 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use Kanboard\Core\User\UserManager; +use Kanboard\User\DatabaseBackendUserProvider; +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * User Provider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ +class UserProvider implements ServiceProviderInterface +{ + /** + * Register providers + * + * @access public + * @param \Pimple\Container $container + * @return \Pimple\Container + */ + public function register(Container $container) + { + $container['userManager'] = new UserManager(); + + if (DB_USER_PROVIDER) { + $container['userManager']->register(new DatabaseBackendUserProvider($container)); + } + + return $container; + } +} |