コード例 #1
0
ファイル: Jar.php プロジェクト: queued/mavis
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->slim = Kernel::instance()->getSlim();
     $container = $this->slim->getContainer();
     $this->cipher = $container->get('cipher');
     $this->response = $container->get('response');
 }
コード例 #2
0
ファイル: ExHanMiddleware.php プロジェクト: queued/mavis
 public function __invoke($request, $response, $next)
 {
     $slim = Kernel::instance()->getSlim();
     $container = $slim->getContainer();
     $handler = new InvocableHandler($slim, $container);
     $container['errorHandler'] = function () use($handler) {
         return $handler;
     };
     $container['exhan'] = $handler;
     return $next($request, $response);
 }
コード例 #3
0
 public function __construct()
 {
     $slim = Kernel::instance()->getSlim();
     $container = $slim->getContainer();
     $container['errorHandler'] = $this;
     // Set error handler
     set_error_handler(['Mavis\\Middlewares\\Errors\\ServerError', 'errorHandler']);
     // Set fatal error handler
     register_shutdown_function(['Mavis\\Middlewares\\Errors\\ServerError', 'errorHandler']);
     // Supress the error displaing
     ini_set('display_errors', 'Off');
     // Enable the PHP to log errors
     ini_set('log_errors', 'On');
     // Set the PHP log file
     ini_set('error_log', path('storage') . 'logs' . DS . 'error.log');
 }
コード例 #4
0
ファイル: Controller.php プロジェクト: queued/mavis
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->slim = Kernel::instance()->getSlim();
     $this->container = $this->slim->getContainer();
     $this->logger = $this->container->get('logger');
     $this->httpcache = $this->container->get('httpcache');
     $this->session = $this->container->get('session');
     $this->cookie = $this->container->get('cookie');
     $this->flash = $this->container->get('flash');
     $this->csrf = $this->container->get('csrf');
     $this->view = $this->container->get('view');
     $this->acl = $this->container->get('acl');
     /*
     $class = get_called_class();
     $class = str_replace(['Mavis\\App\\Controllers\\', 'Controller'], '', $class);
     $view = ($this->template) ? $this->template : strtolower($class);
     $this->view->setTemplate($view);
     */
 }
コード例 #5
0
ファイル: NotFoundMiddleware.php プロジェクト: queued/mavis
 public function __construct()
 {
     $this->container = Kernel::instance()->getSlim()->getContainer();
 }