本文整理匯總了PHP中gpOutput::FatalNotice方法的典型用法代碼示例。如果您正苦於以下問題:PHP gpOutput::FatalNotice方法的具體用法?PHP gpOutput::FatalNotice怎麽用?PHP gpOutput::FatalNotice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gpOutput
的用法示例。
在下文中一共展示了gpOutput::FatalNotice方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: IncludeScript
/**
* Include a script, unless it has caused a fatal error.
* Using this function allows gpEasy to handle fatal errors that are thrown by the included php scripts
*
* @param string $file The full path of the php file to include
* @param string $include_variation Which variation or adaptation of php's include() function to use (include,include_once,include_if, include_once_if, require ...)
* @param array List of global variables to set
*/
function IncludeScript($file, $include_variation = 'include_once', $globals = array())
{
$exists = file_exists($file);
//check to see if it exists
$include_variation = str_replace('_if', '', $include_variation, $has_if);
if ($has_if && !$exists) {
return;
}
//check for fatal errors
if (gpOutput::FatalNotice('include', $file)) {
return false;
}
//set global variables
foreach ($globals as $global) {
global ${$global};
}
switch ($include_variation) {
case 'include':
$return = (include $file);
break;
case 'include_once':
$return = (include_once $file);
break;
case 'require':
$return = (require $file);
break;
case 'require_once':
$return = (require_once $file);
break;
}
gpOutput::PopCatchable();
return $return;
}