/** * @return AjaxResponse */ protected function initResponse() { $ajaxResponse = new AjaxResponse(); try { $app = App::getInstance(); $ajaxResponse->status = true; $ajaxResponse->result = $app->callFromRequest($this->arguments); } catch (\Exception $e) { $ajaxResponse->status = false; $ajaxResponse->result = null; App::exceptionHandler($e); } $ajaxResponse->notification = Notification::getAll(); return $ajaxResponse; }
public static function errorHandler($errno, $errstr, $errfile, $errline) { if (Config::getInstance()->environment != 'development') { return; } if ($errno == E_STRICT) { return; } $content = $errstr . "\n file " . $errfile . " line " . $errline; if (in_array($errno, static::$phpWarning)) { Notification::warning(1, $content, 'php_warning'); } else { Notification::error(1, $content, 'php_error'); } }