本文整理汇总了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;
}