/** * * @param int $errno * @param string $errmsg * @param string $filename * @param int $linenum * @param string $vars * @param boolean $redirect * @return void */ public static function errorHandler($errno, $errmsg, $filename, $linenum, $vars, $redirect = true) { if (is_integer($errno) && ($errno > E_NOTICE || $errno == 1)) { $host = self::getHostName(); $time = microtime(true) - (double) \model\Request::_session('microtime'); $arr = debug_backtrace(); $len = count($arr); for ($i = 0; $i < $len; $i++) { $arr[$i]['args'][4] = array(); } $paramArr = array('islemKodu' => 'ekle', 'ip_address' => Header::getIpAddress(), 'url' => $_SERVER['REQUEST_URI'], 'get' => json_encode($_GET), 'post' => json_encode($_POST), 'session' => json_encode($_SESSION), 'cookie' => json_encode($_COOKIE), 'execute_time' => $time, 'server_ip' => $_SERVER['SERVER_ADDR'], 'error_no' => $errno, 'message' => $errmsg, 'file' => $filename, 'line' => $linenum, 'host' => $host, 'error_data' => json_encode($arr), 'parameters' => json_encode(Listener::getInstance()->parameters)); $CURL = new Curl(Config::JSON_URL . '/EDV03_PORTAL_PHPError/PhpErrorJSON', $paramArr); $CURL->getArray(); if ($redirect) { Header::redirect(Config::ERROR_URL); } } }
/** * dil dosyalarına göre çeviri yapan method * * @param string $message * @param string $domain * @return string */ public static function getText($message, $domain = null, $defaultLanguage = null) { # parametrik olarak dil dosyasını set eder if (!is_null($defaultLanguage)) { self::setLanguageGettext($defaultLanguage); } if ($domain != null) { $LISTENER =& Listener::getInstance(); if (property_exists($LISTENER, 'getTextDomainArr') && is_array($LISTENER->getTextDomainArr)) { if (!in_array($domain, $LISTENER->getTextDomainArr)) { bindtextdomain($domain, Config::ROOT_PATH . '/language'); bind_textdomain_codeset($domain, Config::CHARACTER_SET); $LISTENER->getTextDomainArr[] = $domain; } } else { bindtextdomain($domain, Config::ROOT_PATH . '/language'); bind_textdomain_codeset($domain, Config::CHARACTER_SET); $LISTENER->getTextDomainArr[] = $domain; } return dgettext($domain, $message); } else { return gettext($message); } if (!is_null($defaultLanguage)) { self::setLanguageGettext(Request::_session('language')); } }