private function _getInstance()
 {
     if ($this->_instance === null) {
         $this->_instance = $this->_diContainer->get($this->_instanceName);
     }
     return $this->_instance;
 }
Example #2
0
 public function modifyWebDispatcher(Container $di)
 {
     /** @var \Aura\View\View $view */
     $view = $di->get('view');
     /** @var \Aura\Dispatcher\Dispatcher $dispatcher */
     $dispatcher = $di->get('aura/web-kernel:dispatcher');
     /** @var \Aura\Web\Response $response */
     $response = $di->get('aura/web-kernel:response');
     /** @var \Aura\Web\Request $request */
     $request = $di->get('aura/web-kernel:request');
     $dispatcher->setObject('hello', function () use($view, $response, $request) {
         $view->setView('api_response');
         $view->setLayout('index');
         $response->content->set($view->__invoke());
     });
     $dispatcher->setObject('system', function () use($view, $response, $request) {
         $view->setView('api_response');
         $view->setLayout('index');
         new \System\setData($request, $response, $view);
     });
     $dispatcher->setObject('alert', function () use($view, $response, $request) {
         $view->setView('api_response');
         $view->setLayout('index');
         new \Alert\Uploader($request, $response, $view);
     });
 }
Example #3
0
 public function modify(Container $di)
 {
     $adr = $di->get('radar/adr:adr');
     /**
      * Middleware
      */
     $adr->middle(new ResponseSender());
     $adr->middle(new ExceptionHandler(new Response()));
     $adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
     $adr->middle('Radar\\Adr\\Handler\\ActionHandler');
     /**
      * Setup
      */
     $adr->input('Blog\\Delivery\\Input\\MergedArray');
     $adr->responder('Blog\\Delivery\\Responder\\Html');
     /**
      * Data
      */
     $postGateway = $di->get('blog/domain:postGateway');
     $postGateway->savePost(new PostEntity('Sample Post 1', 'This is the first sample post.', '', '1'));
     $postGateway->savePost(new PostEntity('Sample Post 2', 'This is the second sample post.', '', '2'));
     $postGateway->savePost(new PostEntity('Sample Post 3', 'This is the third sample post.', '', '3'));
     // $dbh = $di->get('dbh');
     // $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     /**
      * Routing
      */
     $adr->get('ListAllPosts', '/', 'Blog\\Domain\\Interactor\\ListAllPosts')->input('Blog\\Delivery\\Input\\NoneExpected')->defaults(['_view' => 'listposts.html.php']);
     $adr->get('DisplaySinglePost', '/{id}/', 'Blog\\Domain\\Interactor\\DisplaySinglePost')->input('Blog\\Delivery\\Input\\IdOnly')->defaults(['_view' => 'singlepost.html.php']);
     $adr->post('CreateNewPost', '/', 'Blog\\Domain\\Interactor\\CreateNewPost')->input('Blog\\Delivery\\Input\\CreateNewPost')->responder('Blog\\Delivery\\Responder\\Redirect');
 }
Example #4
0
 protected function get($service)
 {
     $services = $this->serviceContainer->getServices();
     if (array_search($service, $services) === false) {
         return false;
     }
     return $this->serviceContainer->get($service);
 }
 protected function createContainer()
 {
     $container = new Container(new Forge(new Config()));
     $container->set('array_iterator', new \ArrayIterator(range(1, 5)));
     $container->set('error', function () {
         throw new \RuntimeException();
     });
     return new AuraContainerAdapter($container);
 }
 public function init()
 {
     $container = new Container(new InjectionFactory(new Resolver(new Reflector())));
     // alternatively you can do
     // $builder = new \Aura\Di\ContainerBuilder();
     // $container = $builder->newInstance();
     $container->set('bicycle_factory', $container->lazyNew('PhpBench\\Benchmarks\\Container\\Acme\\BicycleFactory'));
     $this->container = $container;
 }
 public function modifyWebRouter(Container $di)
 {
     $router = $di->get('aura/web-kernel:router');
     $router->add('hello', '/')->setValues(array('action' => 'hello'));
     // Add an about page
     $router->add('about', '/about')->setValues(array('action' => 'about'));
     // Add a sales data display page
     $router->add('data-view-sales', '/data/view/sales')->setValues(array('action' => 'data-view-sales'));
 }
Example #8
0
 /**
  *
  * Modifies constructed container objects.
  *
  * @param Container $di The DI container.
  *
  */
 public function modify(Container $di)
 {
     $adr = $di->get('radar/adr:adr');
     /**
      * Middleware
      */
     $adr->middle(new ResponseSender());
     $adr->middle(new ExceptionHandler(new Response()));
     $adr->middle('Radar\\Adr\\Handler\\RoutingHandler');
     $adr->middle('Radar\\Adr\\Handler\\ActionHandler');
     //$container->register(new \WhoopsPimple\WhoopsServiceProvider);
     /**
      * Input
      */
     // $adr->input('Application\Input\MergedArray');
     // $adr->input('Application\Input\NoneExpected');
     /**
      * Responder
      */
     // $adr->responder('Application\Responder\AuraViewResponder');
     /**
      * Routes
      */
     /**
      *
      * Index page route
      *
      */
     $adr->get('index.page', '/', \Application\Domain\HelloPayload::class)->responder('Application\\Responder\\AuraViewStaticPage')->defaults(['page' => 'index']);
     // aura view including static partials
     $adr->get('aura.staticpage', '/aura/{page}?', \Application\Domain\Aura::class)->responder('Application\\Responder\\AuraViewStaticPage')->defaults(['page' => 'index'])->tokens(['page' => '|index|mikka|mikka2|mikka3']);
     // database stuff
     $adr->get('aura.page', '/aura/{page}?', \Application\Domain\Aura::class)->responder('Application\\Responder\\AuraViewStaticPage')->defaults(['page' => 'content'])->tokens(['page' => 'content']);
     // page from DB
     $adr->get('db.page', '/dbpage{/page}?', \Application\Domain\Page::class)->input('Application\\Input\\Page')->responder('Application\\Responder\\AuraViewStaticPage')->defaults(['page' => 'index'])->tokens(['page' => '|index|mikka|mikka2|mikka3']);
     /**
      *
      * Static page views route
      *
      * @param input:
      * @param responder:
      * @param defaults: the default view to view when not defined
      * @return tokens: the allowed values
      *
      */
     //        $adr->get('static.page', '/page{/page}?', \Application\Domain\HelloPayload::class)
     //            ->input('Application\Input\MergedArray')
     //            ->responder('Application\Responder\AuraViewStaticPage')
     //            ->defaults([
     //                'page' => 'index'
     //            ])
     //            ->tokens([
     //                'page' => '|index|mikka|mikka2|mikka3'
     //            ]);
 }
Example #9
0
 /**
  * @param string $file
  * @return string classname, if not found returns ''
  */
 protected static function findClass(Container $di, $file)
 {
     require_once $file;
     $classname = basename($file, '.php');
     if (!class_exists($classname)) {
         $stdio = $di->get('aura/cli-kernel:stdio');
         $stdio->errln('<<red>>No such class: ' . $classname . ' in ' . $file . '<<reset>>');
         return '';
     }
     return $classname;
 }
Example #10
0
 public function define(Container $di)
 {
     /**
      * Aura\Router\RouteCollection
      */
     $di->params['Aura\\Router\\RouteCollection'] = array('route_factory' => $di->lazyNew('Aura\\Router\\RouteFactory'));
     /**
      * Aura\Router\Router
      */
     $di->params['Aura\\Router\\Router'] = array('routes' => $di->lazyNew('Aura\\Router\\RouteCollection'), 'generator' => $di->lazyNew('Aura\\Router\\Generator'));
 }
Example #11
0
 public function testSerializeAndUnserializeOfReflection()
 {
     $this->container->setAutoResolve(false);
     $this->container->params['Aura\\Di\\FakeParamsClass'] = array('array' => array(), 'empty' => 'abc');
     $instance = $this->container->newInstance('Aura\\Di\\FakeParamsClass');
     $this->assertInstanceOf('Aura\\Di\\FakeParamsClass', $instance);
     $this->container = serialize($this->container);
     $this->container = unserialize($this->container);
     $instance = $this->container->newInstance('Aura\\Di\\FakeParamsClass', array('array' => array('a' => 1)));
     $this->assertInstanceOf('Aura\\Di\\FakeParamsClass', $instance);
 }
Example #12
0
 public function modify(Container $di)
 {
     $dispatcher = $di->get('aura/cli-kernel:dispatcher');
     $dispatcher->setObject('logger', $di->newInstance('Mbrevda\\MonologServer\\ServerRunner'));
     $help_service = $di->get('aura/cli-kernel:help_service');
     $help = $di->newInstance('Aura\\Cli\\Help');
     $help_service->set('logger', function () use($help) {
         $help->setSummary('Runs the Streaming Logger Server');
         $help->setOptions(['addr:' => 'The address that the server will listen on']);
         return $help;
     });
 }
Example #13
0
 protected function setView(Container $di, $templating, $basePath)
 {
     $di->setters['Puzzle\\Core\\View']['setRouter'] = $di->lazyGet("router");
     $di->setters['Puzzle\\Core\\View']['setBaseUrl'] = $templating['baseUrl'];
     $di->setters['Puzzle\\Core\\View']['setSignalManager'] = $di->lazyGet('signal_manager');
     $themePath = $basePath . "/app/Resources/views/" . $templating['active_theme'] . "/";
     $adminThemePath = $basePath . "/app/Resources/views/" . $templating['admin_theme'] . "/";
     $webPath = $basePath . "/web/";
     $di->params['Puzzle\\Core\\View']['themePath'] = $themePath;
     $di->params['Puzzle\\Core\\View']['adminThemePath'] = $adminThemePath;
     $di->params['Puzzle\\Core\\View']['webPath'] = $webPath;
     $di->set("view", $di->lazyNew("Puzzle\\Core\\View"));
 }
Example #14
0
 public function define(Container $di)
 {
     /**
      * Services
      */
     $di->params['Application\\Domain\\Home']['payload'] = $di->lazyNew('Aura\\Payload\\Payload');
     /**
      * Environment
      */
     /**
      * Responder
      */
 }
Example #15
0
 public function testDIMultiInstance()
 {
     $key1 = 'hello';
     $value1 = new \stdClass();
     $key2 = 'Night';
     $value2 = new \stdClass();
     //register key1 in first instance, key2 in second instance
     $this->aura->set($key1, $value1);
     $aura = new AuraContainer(new Forge(new Config()));
     $aura->set($key2, $value2);
     $adapter = new AuraAdapter($aura);
     $this->container->provider($adapter);
     $this->assertEquals($value1, $this->container->get($key1));
     $this->assertEquals($value2, $this->container->get($key2));
 }
Example #16
0
 public function define(Container $di)
 {
     /**
      * Services
      */
     $di->set('intl_package_factory', $di->lazyNew('Aura\\Intl\\PackageFactory'));
     $di->set('intl_translator_locator', $di->lazyNew('Aura\\Intl\\TranslatorLocator'));
     /**
      * Aura\Intl\FormatterLocator
      */
     $di->params['Aura\\Intl\\FormatterLocator']['registry'] = ['basic' => $di->lazyNew('Aura\\Intl\\BasicFormatter'), 'intl' => $di->lazyNew('Aura\\Intl\\IntlFormatter')];
     /**
      * Aura\Intl\TranslatorLocator
      */
     $di->params['Aura\\Intl\\TranslatorLocator'] = ['locale' => 'en_US', 'factory' => $di->lazyNew('Aura\\Intl\\TranslatorFactory'), 'formatters' => $di->lazyNew('Aura\\Intl\\FormatterLocator'), 'packages' => $di->lazyNew('Aura\\Intl\\PackageLocator')];
 }
Example #17
0
 /**
  * @inheritDoc
  */
 public function define(Container $di)
 {
     $di->set('event_dispatcher', $di->lazyNew(EventDispatcher::class));
     $di->params[Application::class]['eventDispatcher'] = $di->lazyGet('event_dispatcher');
     $di->params[Application::class]['contextFactory'] = $di->lazyNew(ContextFactory::class);
     $di->params[ContextFactory::class]['eventDispatcher'] = $di->lazyGet('event_dispatcher');
     $di->params[ContextFactory::class]['optionDefinitionParser'] = $di->lazyNew(OptionDefinitionParser::class);
     $di->params[ContextFactory::class]['usageParserBuilder'] = $di->lazyNew(UsageParserBuilder::class);
 }
Example #18
0
 /**
  *
  * Creates a new DI container, adds pre-existing service objects, applies
  * Config classes to define() services, locks the container, and applies
  * the Config instances to modify() services.
  *
  * @param array $services Pre-existing service objects to set into the
  * container.
  *
  * @param array $configClasses A list of Config classes to instantiate and
  * invoke for configuring the container.
  *
  * @param bool $autoResolve Enable or disable auto-resolve after the
  * define() step?
  *
  * @return Container
  *
  */
 public function newInstance(array $services = [], array $configClasses = [], $autoResolve = true)
 {
     $di = new Container(new Factory());
     $di->setAutoResolve($autoResolve);
     foreach ($services as $key => $val) {
         $di->set($key, $val);
     }
     $configs = [];
     foreach ($configClasses as $class) {
         $configs[] = $config = is_string($class) ? $di->newInstance($class) : $class;
         $config->define($di);
     }
     $di->lock();
     foreach ($configs as $config) {
         $config->modify($di);
     }
     return $di;
 }
Example #19
0
 public function define(Container $di)
 {
     $di->set('event_dispatcher', $di->lazyNew(EventDispatcher::class));
     $di->params[Application::class]['eventDispatcher'] = $di->lazyGet('event_dispatcher');
     $di->params[Application::class]['contextFactory'] = $di->lazyNew(ContextFactory::class);
     $di->params[Application::class]['plugins'] = $di->lazy(function () {
         $plugins = [];
         $plugins[] = new ContextualHelpPlugin();
         $plugins[] = new VersionInfoPlugin();
         return $plugins;
     });
     $di->params[ContextFactory::class]['eventDispatcher'] = $di->lazyGet('event_dispatcher');
     $di->params[ContextFactory::class]['optionDefinitionParser'] = $di->lazyNew(OptionDefinitionParser::class);
     $di->params[ContextFactory::class]['usageParserBuilder'] = $di->lazyNew(UsageParserBuilder::class);
 }
Example #20
0
 public function define(Container $di)
 {
     //$di->set('era:payload_factory', $di->lazyNew(\Aura\Payload\PayloadFactory::class));
     //$di->params[\Era\Domain\Home\AppService\Home::class]['payload'] = $di->lazyGetCall('era:payload_factory', 'newInstance');
     $di->params['Era\\Domain\\Home\\AppService\\Home']['payload'] = $di->lazyNew('Aura\\Payload\\Payload');
     $di->set('era:twig', $di->lazyNew('Twig_Environment'));
     $di->set('era:twig-loader', $di->lazyNew('Twig_Loader_Filesystem'));
     $di->params['Era\\Http\\Responder\\TwigResponder']['twig'] = $di->lazyGet('era:twig');
     $di->params['Twig_Environment']['loader'] = $di->lazyGet('era:twig-loader');
     $di->params['Twig_Environment']['options'] = ['cache' => ERA_ROOT . '/cache/twig', 'auto_reload' => true];
     $di->params['Twig_Loader_Filesystem']['paths'] = [ERA_ROOT . '/views'];
 }
Example #21
0
 /**
  * @throws Exception\ContentTypeNotValidException
  * @throws NotFoundException
  * @throws \Exception
  */
 public function execute()
 {
     $config = $this->config->getConfig();
     // Figure out the route information.
     try {
         $routepath = $this->evaluateRoute();
         $route = $routepath->params;
         $components = $this->determineRouteComponents($route);
         $params = $route;
         unset($params['action']);
         unset($params['responder']);
         unset($params['method']);
     } catch (NotFoundException $e) {
         if (isset($config['error_page']['404'])) {
             $lastRoute = $this->router->getLastRoute();
             $this->eventLog->info(sprintf("No route was found that matches '%s'", $lastRoute));
             $responder = $this->serviceLocator->newInstance($config['error_page']['404']);
             $this->responseManager->process(new Payload(), $responder);
             return;
         }
         // No 404 page was set, so let's throw the exception.
         throw $e;
     }
     // Load the responder that we identified from routes.
     $responder = $this->serviceLocator->newInstance($components['responderClass']);
     // Load the action we identified from routes, if one exists.
     if (!is_null($components['actionClass'])) {
         $action = $this->serviceLocator->newInstance($components['actionClass']);
         if (!is_callable([$action, $components['actionMethod']])) {
             throw new NoValidMethod(sprintf('The method %s does not exist on action %s', $components['actionMethod'], $components['actionClass']));
         }
         // Call the action.
         $result = call_user_func_array([$action, $components['actionMethod']], $params);
     }
     // Let's not leave the response hanging...
     if (!isset($result) || !$result) {
         $result = new Payload();
     }
     // Call and send the response, if possible.
     $this->responseManager->process($result, $responder);
 }
Example #22
0
 public function define(Container $di)
 {
     /*
         why can't a trait be set?
     
         $u = User();
         $m = new \Domain\Todo\Mapper;
         $t = new \Domain\Todo\TodoEntity;
         $p = new \Aura\Payload\Payload();
     
         $di->params['Domain\Todo\ApplicationService\EditItem']['user'] = $u;
         $di->params['Domain\Todo\ApplicationService\EditItem']['mapper'] = $m;
         $di->params['Domain\Todo\ApplicationService\EditItem']['payload'] = $p;
     
         $di->params['Domain\Todo\ApplicationService\AddItem']['user'] = $u;
         $di->params['Domain\Todo\ApplicationService\AddItem']['mapper'] = $m;
         $di->params['Domain\Todo\ApplicationService\AddItem']['payload'] = $p;
     
         $di->params['Domain\Todo\ApplicationService\GetList']['user'] = $u;
         $di->params['Domain\Todo\ApplicationService\GetList']['mapper'] = $m;
         $di->params['Domain\Todo\ApplicationService\GetList']['payload'] = $p;
        
         $di->params['Domain\Todo\ApplicationService\DeleteItem']['user'] = $u;
         $di->params['Domain\Todo\ApplicationService\DeleteItem']['mapper'] = $m;
         $di->params['Domain\Todo\ApplicationService\DeleteItem']['payload'] = $p;
     */
     $databaseHandle = \defaultTodoPdo();
     $di->params['Aura\\Sql\\ExtendedPdo']['dsn'] = $databaseHandle;
     $di->set('aura/payload', $di->lazyNew('Aura\\Payload\\Payload'));
     $di->set('user', $di->lazyNew('Domain\\User\\User'));
     $di->types['User'] = $di->lazyGet('user');
     $di->params['Aura\\Auth\\AuthFactory']['cookie'] = $_COOKIE;
     $di->params['Aura\\Auth\\Verifier\\PasswordVerifier']['algo'] = PASSWORD_DEFAULT;
     // should be optional
 }
Example #23
0
 public function define(Container $di)
 {
     /**
      * Services
      */
     $di->set('aura/session:session', $di->lazyNew('Aura\\Session\\Session'));
     /**
      * Aura\Session\CsrfTokenFactory
      */
     $di->params['Aura\\Session\\CsrfTokenFactory']['randval'] = $di->lazyNew('Aura\\Session\\Randval');
     /**
      * Aura\Session\Session
      */
     $di->params['Aura\\Session\\Session'] = array('segment_factory' => $di->lazyNew('Aura\\Session\\SegmentFactory'), 'csrf_token_factory' => $di->lazyNew('Aura\\Session\\CsrfTokenFactory'), 'cookies' => $_COOKIE, 'phpfunc' => $di->lazyNew('Aura\\Session\\Phpfunc'));
     /**
      * Aura\Session\Randval
      */
     $di->params['Aura\\Session\\Randval']['phpfunc'] = $di->lazyNew('Aura\\Session\\Phpfunc');
     /**
      * Aura\Session\Segment
      */
     $di->params['Aura\\Session\\Segment'] = array('session' => $di->lazyGet('aura/session:session'));
 }
Example #24
0
 protected function modifyCliDispatcherAndHelp(Container $di)
 {
     //        $context = $di->get('aura/cli-kernel:context');
     //        $stdio = $di->get('aura/cli-kernel:stdio');
     //        $logger = $di->get('aura/project-kernel:logger');
     $dispatcher = $di->get('aura/cli-kernel:dispatcher');
     $help_service = $di->get('aura/cli-kernel:help_service');
     // register built-in commands
     foreach ($this->commands as $command) {
         $class = 'CLI\\Command\\' . $command;
         $command_name = strtolower($command);
         $dispatcher->setObject($command_name, $di->lazyNew($class));
         $help_class = 'CLI\\Command\\' . $command . 'Help';
         $help_service->set($command_name, $di->lazyNew($help_class));
     }
     // register user commands
     UserConfig::registerCommands($di, $dispatcher, $help_service, $this->user_command_paths);
 }
<?php

use Aura\Di\Container;
use Aura\Di\Factory;
$di = new Container(new Factory());
$di->set('A', $di->lazyNew('A'));
//Trigger the autoloader
$a = $di->get('A');
unset($a);
$t1 = microtime(true);
for ($i = 0; $i < 10000; $i++) {
    $j = $di->get('A');
}
$t2 = microtime(true);
$results = ['time' => $t2 - $t1, 'files' => count(get_included_files()), 'memory' => memory_get_peak_usage() / 1024 / 1024];
echo json_encode($results);
<?php

use Aura\Di\Container;
use Aura\Di\Factory;
$di = new Container(new Factory());
$di->set('A', $di->lazyNew('A'));
//trigger autoloader for all required files
$a = $di->newinstance('A');
unset($a);
$t1 = microtime(true);
for ($i = 0; $i < 10000; $i++) {
    $a = $di->newinstance('A');
}
$t2 = microtime(true);
$results = ['time' => $t2 - $t1, 'files' => count(get_included_files()), 'memory' => memory_get_peak_usage() / 1024 / 1024];
echo json_encode($results);
Example #27
0
 public function define(Container $di)
 {
     $di->params['Aura\\View\\View'] = array('view_registry' => $di->lazyNew('Aura\\View\\TemplateRegistry'), 'layout_registry' => $di->lazyNew('Aura\\View\\TemplateRegistry'), 'helpers' => $di->lazyNew('Aura\\View\\HelperRegistry'));
 }
Example #28
0
 public function define(Container $di)
 {
     $di->params['Aura\\View\\View']['helpers'] = $di->lazyGet('aura/html:helper');
 }
Example #29
0
 public function define(Container $di)
 {
     /**
      * Services
      */
     $di->set('aura/auth:auth', $di->lazyNew('Aura\\Auth\\Auth'));
     $di->set('aura/auth:login_service', $di->lazyNew('Aura\\Auth\\Service\\LoginService'));
     $di->set('aura/auth:logout_service', $di->lazyNew('Aura\\Auth\\Service\\LogoutService'));
     $di->set('aura/auth:resume_service', $di->lazyNew('Aura\\Auth\\Service\\ResumeService'));
     $di->set('aura/auth:session', $di->lazyNew('Aura\\Auth\\Session\\Session'));
     $di->set('aura/auth:adapter', $di->lazyNew('Aura\\Auth\\Adapter\\NullAdapter'));
     /**
      * Aura\Auth\Adapter\HtpasswdAdapter
      */
     $di->params['Aura\\Auth\\Adapter\\HtpasswdAdapter'] = array('verifier' => $di->lazyNew('Aura\\Auth\\Verifier\\HtpasswdVerifier'));
     /**
      * Aura\Auth\Adapter\ImapAdapter
      */
     $di->params['Aura\\Auth\\Adapter\\ImapAdapter'] = array('phpfunc' => $di->lazyNew('Aura\\Auth\\Phpfunc'));
     /**
      * Aura\Auth\Adapter\LdapAdapter
      */
     $di->params['Aura\\Auth\\Adapter\\LdapAdapter'] = array('phpfunc' => $di->lazyNew('Aura\\Auth\\Phpfunc'));
     /**
      * Aura\Auth\Adapter\PdoAdapter
      */
     $di->params['Aura\\Auth\\Adapter\\PdoAdapter'] = array('verifier' => $di->lazyNew('Aura\\Auth\\Verifier\\PasswordVerifier'), 'from' => 'users', 'cols' => array('username', 'password'));
     /**
      * Aura\Auth\Auth
      */
     $di->params['Aura\\Auth\\Auth'] = array('segment' => $di->lazyNew('Aura\\Auth\\Session\\Segment'));
     /**
      * Aura\Auth\Service\LoginService
      */
     $di->params['Aura\\Auth\\Service\\LoginService'] = array('adapter' => $di->lazyGet('aura/auth:adapter'), 'session' => $di->lazyGet('aura/auth:session'));
     /**
      * Aura\Auth\Service\LogoutService
      */
     $di->params['Aura\\Auth\\Service\\LogoutService'] = array('adapter' => $di->lazyGet('aura/auth:adapter'), 'session' => $di->lazyGet('aura/auth:session'));
     /**
      * Aura\Auth\Service\ResumeService
      */
     $di->params['Aura\\Auth\\Service\\ResumeService'] = array('adapter' => $di->lazyGet('aura/auth:adapter'), 'session' => $di->lazyGet('aura/auth:session'), 'timer' => $di->lazyNew('Aura\\Auth\\Session\\Timer'), 'logout_service' => $di->lazyGet('aura/auth:logout_service'));
     /**
      * Aura\Auth\Session\Timer
      */
     $di->params['Aura\\Auth\\Session\\Timer'] = array('ini_gc_maxliftime' => ini_get('session.gc_maxlifetime'), 'ini_cookie_liftime' => ini_get('session.cookie_lifetime'), 'idle_ttl' => 1440, 'expire_ttl' => 14400);
     /**
      * Aura\Auth\Session\Session
      */
     $di->params['Aura\\Auth\\Session\\Session'] = array('cookie' => $_COOKIE);
     /**
      * Aura\Auth\Verifier\PasswordVerifier
      */
     $di->params['Aura\\Auth\\Verifier\\PasswordVerifier'] = array('algo' => 'NO_ALGO_SPECIFIED');
 }
 /**
  * Defines configuration for the dependency injection container
  *
  * @param Container $di Aura dependency injection container
  */
 public function define(Container $di)
 {
     $di->set('Aura\\Cli\\Context', $di->lazyNew('Aura\\Cli\\Context'));
     $di->set('Aura\\Cli\\Help', $di->lazyNew('Aura\\Cli\\Help'));
     // Typehinted dependency resolution for command classes
     $di->params['ShootProof\\Cli\\Command\\BaseCommand']['stdio'] = $di->lazyNew('Aura\\Cli\\Stdio');
     $di->params['ShootProof\\Cli\\Command\\BaseCommand']['api'] = $di->get('ShootProofApi');
     $di->params['ShootProof\\Cli\\Command\\BaseCommand']['logger'] = $di->get('Logger');
     $di->types['Help'] = $di->lazyGet('Help');
     // Map CLI keywords to command classes
     $di->set('push', $di->lazyNew('ShootProof\\Cli\\Command\\PushCommand'));
     $di->set('pull', $di->lazyNew('ShootProof\\Cli\\Command\\PullCommand'));
     $di->set('accesslevel', $di->lazyNew('ShootProof\\Cli\\Command\\AccesslevelCommand'));
     $di->set('brands', $di->lazyNew('ShootProof\\Cli\\Command\\BrandsCommand'));
     $di->set('help', $di->lazyNew('ShootProof\\Cli\\Command\\HelpCommand'));
 }