$_POST = addslashes_deep($_POST); } $_COOKIE = addslashes_deep($_COOKIE); $_REQUEST = addslashes_deep($_REQUEST); } function addslashes_deep($value) { if (empty($value)) { return $value; } else { return is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value); } } try { $app = new Yaf\Application(APP_PATH . "/conf/application.ini"); switch ($app->environ()) { case 'testing': default: error_reporting(E_ALL); ini_set('display_errors', 'On'); break; case 'production': error_reporting(0); ini_set('display_errors', 'Off'); break; } $app->bootstrap()->run(); echo '<!--' . round((microtime(true) - STARTTIME) * 1000) . 'ms-->'; } catch (Exception $e) { file_put_contents('log/yaf.log', "[" . date("Y-m-d H:i:s", time()) . "]" . $e->getCode() . '--' . $e->getMessage() . "\r\n", FILE_APPEND); header('location:/');