Пример #1
0
 /**
  * Registers the service provider with a DI container.
  *
  * @param   Container $container The DI container.
  *
  * @return  void
  */
 public function register(Container $container)
 {
     $closure = function (Container $container) {
         return new \S3($container->get('app')->get('amazon.access_key'), $container->get('app')->get('amazon.secret_key'));
     };
     Ioc::getContainer()->share('s3', $closure);
 }
Пример #2
0
 /**
  * onBeforeRouting
  *
  * @param Event $event
  *
  * @return  void
  *
  * @throws \Exception
  */
 public function onAfterRouting(Event $event)
 {
     $app = Ioc::getApplication();
     $controller = Ioc::get('main.controller');
     $route = $app->get('uri.route');
     if (trim($route, '/')) {
         return;
     }
     Ioc::getContainer()->share('main.controller', $controller);
 }
Пример #3
0
 /**
  * onAfterInitialise
  *
  * @param Event $event
  *
  * @return  void
  */
 public function onAfterInitialise(Event $event)
 {
     Ioc::getContainer()->share('system.profiler', new Profiler('system'));
 }