mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 08:17:18 +08:00
git-subtree-dir: public/legacy git-subtree-split: 817a12dc0c30c189f56d5cb1f7dc37a9631bdbe3
29 lines
777 B
PHP
29 lines
777 B
PHP
<?php
|
|
namespace Api\Core\Loader;
|
|
|
|
use Api\Core\Config\ApiConfig;
|
|
use Api\Core\Resolver\ConfigResolver;
|
|
use Psr\Container\ContainerInterface;
|
|
use Slim\Container;
|
|
|
|
class ContainerLoader
|
|
{
|
|
/**
|
|
* Load all service containers and add slim settings
|
|
*
|
|
* @return ContainerInterface
|
|
*/
|
|
public static function configure()
|
|
{
|
|
$slimSettings = ConfigResolver::loadFiles(ApiConfig::getSlimSettings());
|
|
// if we want to use this without DI, should create an instance for it
|
|
$container = new Container($slimSettings);
|
|
|
|
$services = ConfigResolver::loadFiles(ApiConfig::getContainers());
|
|
foreach ($services as $service => $closure) {
|
|
$container[$service] = $closure;
|
|
}
|
|
|
|
return $container;
|
|
}
|
|
}
|