本文整理匯總了PHP中ET::webPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP ET::webPath方法的具體用法?PHP ET::webPath怎麽用?PHP ET::webPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ET
的用法示例。
在下文中一共展示了ET::webPath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: errorHandler
function errorHandler($code, $message, $file, $line)
{
// Make sure this error code is included in error_reporting.
if ((error_reporting() & $code) != $code) {
return false;
}
ET::fatalError(new ErrorException($message, $code, 1, $file, $line));
}
set_error_handler("errorHandler", E_USER_ERROR);
set_exception_handler(array("ET", "fatalError"));
// Determine the relative path to this forum. For example, if the forum is at http://forum.com/test/forum/,
// the web path should be /test/forum.
$parts = explode("/", $_SERVER["PHP_SELF"]);
$key = array_search("index.php", $parts);
if ($key !== false) {
ET::$webPath = implode("/", array_slice($parts, 0, $key));
}
// Undo register_globals.
undoRegisterGlobals();
// If magic quotes is on, strip the slashes that it added.
if (get_magic_quotes_gpc()) {
$_REQUEST = array_map("undoMagicQuotes", $_REQUEST);
$_GET = array_map("undoMagicQuotes", $_GET);
$_POST = array_map("undoMagicQuotes", $_POST);
$_COOKIE = array_map("undoMagicQuotes", $_COOKIE);
}
//***** 2. INCLUDE CONFIGURATION
// Include our config files.
ET::loadConfig(PATH_CORE . "/config.defaults.php");
// If the config path is different from the default, but there's still a config file at the default location, include it.
if (PATH_CONFIG != PATH_ROOT . "/config" and file_exists($file = PATH_ROOT . "/config/config.php")) {