public function register(ContainerInterface $app)
 {
     $whoops = new Whoops();
     $whoops->pushHandler(new PrettyPageHandler());
     $whoops->register();
     $app->instance(Whoops::class, $whoops);
 }
Example #2
0
 public function register(ContainerInterface $app)
 {
     $app->singleton(Connection::class, function ($app) {
         return Connection::factory($app['config']['database']);
     });
     $app->alias('connection', Connection::class);
 }
Example #3
0
 public function register(ContainerInterface $app)
 {
     $app->singleton(Input::class, function ($app) {
         return new Input($app['request']);
     });
     $app->alias('input', Input::class);
 }
Example #4
0
 public function register(ContainerInterface $app)
 {
     $app->singleton('session.handler', function ($app) {
         return new FileHandler($app['config']['session']['path']);
     });
     $app->singleton('session', function ($app) {
         return new Manager($app['config']['session']['name'], $app['session.handler']);
     });
 }
Example #5
0
 public function register(ContainerInterface $app)
 {
     $app->singleton('router', function ($app) {
         return new Router($app['router.controllers'], $app['config']['router']);
     });
     $app->singleton('router.controllers', function () {
         return new Container();
     });
 }
 public function register(ContainerInterface $container)
 {
     $container->singleton('repository.users', function ($app) {
         return new Users($app['connection']);
     });
     $container->singleton('repository.posts', function ($app) {
         return new Posts($app['connection']);
     });
     $container->singleton('repository.categories', function ($app) {
         return new Categories($app['connection']);
     });
 }
Example #7
0
 public function register(ContainerInterface $app)
 {
     $app->singleton('view', function ($app) {
         return new Manager($app['path'] . '/views');
     });
 }