public function errorHandler($errno, $errstr, $errfile = "", $errline = "", $errcontext = "") { $message = "errno:" . $errno . " errstr:" . $errstr . " errfile:" . $errfile . " errline:" . $errline . " errcontext:" . json_encode($errcontext) . " Backtrace: " . clm_core::getBacktrace(); switch ($errno) { case E_USER_ERROR: $this->addError("E_USER_ERROR", $message); break; case E_ERROR: $this->addError("E_ERROR", $message); break; case E_USER_WARNING: $this->addWarning("E_USER_WARNING", $message); break; case E_WARNING: $this->addWarning("E_WARNING", $message); break; case E_USER_NOTICE: $this->addNotice("E_USER_NOTICE", $message); break; case E_NOTICE: $this->addNotice("E_NOTICE", $message); break; default: $this->addUnknown("Unknown", $message); break; } // Normales Handling bleibt aktiv return false; }
public function query($query) { if (!($result = $this->db[0]->query(clm_core::$load->db_add_prefix($query, $this->db[1])))) { clm_core::addError("sql invalid", $query . " (" . $this->db[0]->error . ")" . " Backtrace: " . clm_core::getBacktrace()); } else { return $result; } }
function clm_function_load_css($css) { $path = clm_core::$path . DS . "css" . DS . $css . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addWarning("css missing", $path . " (" . $css . ")" . " Backtrace: " . clm_core::getBacktrace()); } }
private function autoInclude($api) { if (!function_exists("clm_api_" . $api)) { $path = clm_core::$path . DS . "api" . DS . $api . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addError("api missing", $path . " (" . $api . ")" . " Backtrace: " . clm_core::getBacktrace()); } } }
function clm_function_load_view($view, $args, $div = true) { clm_core::$load->load_css("reset"); if (!function_exists("clm_view_" . $view)) { $path = clm_core::$path . DS . "views" . DS . $view . '.php'; if (file_exists($path)) { require_once $path; } else { clm_core::addError("view missing", $path . " (" . $view . ")" . " Backtrace: " . clm_core::getBacktrace()); } } ob_start(); $out[0] = call_user_func_array("clm_view_" . $view, $args); if ($div) { $out[1] = '<div class="clm_view_' . $view . '">' . ob_get_contents() . "</div>"; } else { $out[1] = ob_get_contents(); } ob_end_clean(); return $out; }