本文整理匯總了PHP中Reg::del方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reg::del方法的具體用法?PHP Reg::del怎麽用?PHP Reg::del使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Reg
的用法示例。
在下文中一共展示了Reg::del方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadURL
/**
* Loads the url for the error. If the url points to a page inside the framework the function attempts to load it and handles any errors
* or issues associated such as loading in a default error. If the url points to a page outside the framework then header location is set
* and execution is stopped.
*
* @access public
* @static
* @final
* @param string|array $url The url that should be loaded can be the url or an array in the URI.map format
*/
public function loadURL($url)
{
// call hook
Hook::call('Exception.loadURL.before', array(&$url));
if (!empty($url)) {
if (!is_array($url) && preg_match("/^(http:|https:|ftp:|ftps:)/im", $url)) {
// call hook
Hook::call('Exception.loadURL.redirect', array(&$url));
header('Location: ' . $url);
header('Connection: close');
exit;
}
if (is_array($url)) {
$url = '/' . implode('/', array_merge(Reg::get("URI.map"), $url));
}
$url = str_replace(Reg::get('Path.root'), "", $url);
$_SERVER['REQUEST_URI'] = $url;
Reg::set("URI.working", $url);
Reg::del("Branch.name");
Config::processURI();
$load['name'] = Config::uriToClass(Reg::get("URI.working.controller"));
if (Reg::hasVal("Branch.name")) {
$load['branch'] = Config::uriToClass(Reg::get("Branch.name"));
}
$load['type'] = 'Controller';
$load = implode('_', $load);
$controller = new $load();
if (!is_object($controller)) {
if (!file_exists(Reg::get("System.defaultError404"))) {
include Reg::get("System.defaultError404");
} else {
echo Reg::get("System.defaultError404");
}
} else {
try {
// call hook
Hook::call('Exception.loadURL.controller', array(&$controller));
$controller->_showView();
} catch (EvergreenException $e) {
var_dump($e);
exit;
if (Reg::get("System.mode") == "development") {
if (isset(self::$params['code'])) {
$code = self::$params['code'];
}
// call hook
Hook::call('Exception.loadURL.default', array(&$url, &$code));
switch ($code) {
case 'GEN':
if (file_exists(Reg::get("System.defaultErrorGEN"))) {
include Reg::get("System.defaultErrorGEN");
} else {
echo Reg::get("System.defaultErrorGEN");
}
break;
case 'DB':
if (file_exists(Reg::get("System.defaultErrorDB"))) {
include Reg::get("System.defaultErrorDB");
} else {
echo Reg::get("System.defaultErrorDB");
}
break;
default:
if (file_exists(Reg::get("System.defaultErrorGEN"))) {
include Reg::get("System.defaultErrorGEN");
} else {
echo Reg::get("System.defaultErrorGEN");
}
break;
}
}
}
}
} else {
if (file_exists(Reg::get("System.defaultErrorGEN"))) {
include Reg::get("System.defaultErrorGEN");
} else {
echo Reg::get("System.defaultErrorGEN");
}
}
}
示例2: remove
/**
* Legacy method used to remove a global registry variable.
*
* @access public
* @static
* @param string $key The registration variable that is being accessed
* @return boolean true if successful and boolean false if not
*/
public static function remove($key)
{
return Reg::del($key);
}