本文整理汇总了PHP中PEAR_Singleton::RaiseError方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Singleton::RaiseError方法的具体用法?PHP PEAR_Singleton::RaiseError怎么用?PHP PEAR_Singleton::RaiseError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_Singleton
的用法示例。
在下文中一共展示了PEAR_Singleton::RaiseError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$service = new $action();
$timer->logTime('Start launch of action');
$service->launch();
$timer->logTime('Finish launch of action');
} elseif (class_exists($moduleActionClass, false)) {
/** @var Action $service */
$service = new $moduleActionClass();
$timer->logTime('Start launch of action');
$service->launch();
$timer->logTime('Finish launch of action');
} else {
PEAR_Singleton::raiseError(new PEAR_Error('Unknown Action'));
}
} else {
$requestURI = $_SERVER['REQUEST_URI'];
PEAR_Singleton::RaiseError(new PEAR_Error("Cannot Load Action '{$action}' for Module '{$module}' request '{$requestURI}'"));
}
$timer->logTime('Finished Index');
$timer->writeTimings();
//$analytics->finish();
function processFollowup()
{
global $configArray;
switch ($_REQUEST['followup']) {
case 'SaveSearch':
header("Location: {$configArray['Site']['path']}/" . $_REQUEST['followupModule'] . "/" . $_REQUEST['followupAction'] . "?" . $_REQUEST['recordId']);
die;
break;
}
}
/**
示例2: initBasicSearch
/**
* Initialize the object's search settings for a basic search found in the
* $_REQUEST superglobal.
*
* @access protected
* @return boolean True if search settings were found, false if not.
*/
protected function initBasicSearch()
{
// If no lookfor parameter was found, we have no search terms to
// add to our array!
if (!isset($_REQUEST['lookfor'])) {
return false;
}
// If lookfor is an array, we may be dealing with a legacy Advanced
// Search URL. If there's only one parameter, we can flatten it,
// but otherwise we should treat it as an error -- no point in going
// to great lengths for compatibility.
if (is_array($_REQUEST['lookfor'])) {
if (count($_REQUEST['lookfor']) == 1) {
$_REQUEST['lookfor'] = strip_tags($_REQUEST['lookfor'][0]);
} else {
PEAR_Singleton::RaiseError(new PEAR_Error("Unsupported search URL."));
die;
}
}
// If no type defined use default
if (isset($_REQUEST['type']) && $_REQUEST['type'] != '') {
$type = $_REQUEST['type'];
// Flatten type arrays for backward compatibility:
if (is_array($type)) {
$type = strip_tags($type[0]);
} else {
$type = strip_tags($type);
}
} else {
$type = $this->defaultIndex;
}
$this->searchTerms[] = array('index' => $type, 'lookfor' => $_REQUEST['lookfor']);
return true;
}