当前位置: 首页>>代码示例>>PHP>>正文


PHP gpOutput::PopCatchable方法代码示例

本文整理汇总了PHP中gpOutput::PopCatchable方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::PopCatchable方法的具体用法?PHP gpOutput::PopCatchable怎么用?PHP gpOutput::PopCatchable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gpOutput的用法示例。


在下文中一共展示了gpOutput::PopCatchable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:Knuzen,项目名称:gpEasy-CMS,代码行数:41,代码来源:common.php

示例2: ExecInfo

 /**
  * Execute a set of directives for theme areas, hooks and special pages
  *
  */
 static function ExecInfo($info, $args = array())
 {
     global $dataDir, $addonFolderName, $installed_addon, $config, $page, $gp_overwrite_scripts;
     //addonDir is deprecated as of 2.0b3
     if (isset($info['addonDir'])) {
         if (gp_safe_mode) {
             return;
         }
         gpPlugin::SetDataFolder($info['addonDir']);
     } elseif (isset($info['addon'])) {
         if (gp_safe_mode) {
             return;
         }
         gpPlugin::SetDataFolder($info['addon']);
     }
     //if addon was just installed
     if ($installed_addon && $installed_addon === $addonFolderName) {
         gpPlugin::ClearDataFolder();
         return $args;
     }
     // check for fatal errors
     if (self::FatalNotice('exec', $info)) {
         return $args;
     }
     //data
     if (!empty($info['data'])) {
         IncludeScript($dataDir . $info['data'], 'include_if', array('page', 'dataDir', 'langmessage'));
     }
     //script
     $has_script = false;
     if (isset($info['script'])) {
         if (is_array($gp_overwrite_scripts) && isset($gp_overwrite_scripts[$info['script']])) {
             $full_path = $gp_overwrite_scripts[$info['script']];
         } else {
             $full_path = $dataDir . $info['script'];
         }
         if (!file_exists($full_path)) {
             $name =& $config['addons'][$addonFolderName]['name'];
             trigger_error('gpEasy Error: Addon hook script doesn\'t exist. Script: ' . $info['script'] . ' Addon: ' . $name);
         } elseif (IncludeScript($full_path, 'include_once', array('page', 'dataDir', 'langmessage'))) {
             $has_script = true;
         }
     }
     //class & method
     if (!empty($info['class'])) {
         if (class_exists($info['class'])) {
             $object = new $info['class']($args);
             if (!empty($info['method'])) {
                 if (method_exists($object, $info['method'])) {
                     $args[0] = call_user_func_array(array($object, $info['method']), $args);
                 } elseif ($has_script) {
                     trigger_error('gpEasy Error: Addon hook method doesn\'t exist. Script: ' . $info['method']);
                 }
             }
         } elseif ($has_script) {
             $name =& $config['addons'][$addonFolderName]['name'];
             trigger_error('gpEasy Error: Addon class doesn\'t exist. Class: ' . $info['class'] . ' Addon: ' . $name);
         } else {
             trigger_error('gpEasy Error: Addon class doesn\'t exist. Class: ' . $info['class']);
         }
     } elseif (!empty($info['method'])) {
         $callback = $info['method'];
         //object callbacks since gpEasy 3.0
         if (is_string($callback) && strpos($callback, '->') !== false) {
             $has_script = true;
             list($object, $method) = explode('->', $callback);
             if (isset($GLOBALS[$object]) && is_object($GLOBALS[$object]) && method_exists($GLOBALS[$object], $method)) {
                 $callback = array($GLOBALS[$object], $method);
             }
         }
         if (is_callable($callback)) {
             $args[0] = call_user_func_array($callback, $args);
             $method_called = true;
         } elseif ($has_script) {
             $name =& $config['addons'][$addonFolderName]['name'];
             trigger_error('gpEasy Error: Addon hook method doesn\'t exist. Script: ' . $info['method'] . ' Addon: ' . $name);
         }
     }
     gpPlugin::ClearDataFolder();
     gpOutput::PopCatchable();
     return $args;
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:86,代码来源:gpOutput.php

示例3: ExecInfo

 /**
  * Execute a set of directives for theme areas, hooks and special pages
  *
  */
 static function ExecInfo($info, $args = array())
 {
     global $addonFolderName, $installed_addon;
     //addonDir is deprecated as of 2.0b3
     if (isset($info['addonDir'])) {
         if (gp_safe_mode) {
             return;
         }
         gpPlugin::SetDataFolder($info['addonDir']);
     } elseif (isset($info['addon'])) {
         if (gp_safe_mode) {
             return;
         }
         gpPlugin::SetDataFolder($info['addon']);
     }
     //if addon was just installed
     if ($installed_addon && $installed_addon === $addonFolderName) {
         gpPlugin::ClearDataFolder();
         return $args;
     }
     // check for fatal errors
     if (self::FatalNotice('exec', $info)) {
         return $args;
     }
     $args = self::_ExecInfo($info, $args);
     gpPlugin::ClearDataFolder();
     gpOutput::PopCatchable();
     return $args;
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:33,代码来源:gpOutput.php


注:本文中的gpOutput::PopCatchable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。