/** * Class constructor */ public function __construct() { $this->slim = Kernel::instance()->getSlim(); $container = $this->slim->getContainer(); $this->cipher = $container->get('cipher'); $this->response = $container->get('response'); }
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); }
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'); }
/** * 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); */ }
public function __construct() { $this->container = Kernel::instance()->getSlim()->getContainer(); }