本文整理汇总了PHP中SJB_DB::setFunctionInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_DB::setFunctionInfo方法的具体用法?PHP SJB_DB::setFunctionInfo怎么用?PHP SJB_DB::setFunctionInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_DB
的用法示例。
在下文中一共展示了SJB_DB::setFunctionInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeFunction
/**
* Execute module function
*
* This function will execute function of the module
* If function does not exists, it will display error message
*
* @param string $module_name name of the module
* @param string $function_name function's name
* @param array $parameters_override _REQUEST parameters to rewrite
*/
function executeFunction($module_name, $function_name, $parameters_override = array(), $pageID = false)
{
if (SJB_Users_CookiePreferences::isModuleDisabled($function_name)) {
return;
}
ob_start();
if ($this->isFunctionAccessible($module_name, $function_name)) {
$script_filename = $this->getFunctionScriptFilename($module_name, $function_name);
if ($script_filename != null && is_readable($script_filename)) {
$adminAccessType = SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == SJB_System::getSystemSettings('ADMIN_ACCESS_TYPE');
$this->prepareFunctionEnvironment($parameters_override);
$this->pushExecutionStack($module_name, $function_name);
$function = $this->getFunction($function_name, $module_name, $parameters_override);
// permissions checking
if (!$function->isAccessible()) {
if ($adminAccessType && SJB_SubAdmin::admin_authed()) {
$function = $this->getFunction('function_is_not_accessible_for_subadmin', 'miscellaneous');
} else {
$function = $this->getFunction('function_is_not_accessible', 'miscellaneous');
}
SJB_Request::getInstance()->setPageTemplate('index.tpl');
}
if (SJB_Profiler::getInstance()->isProfilerEnable()) {
SJB_DB::setFunctionInfo($function_name, $module_name);
$startTime = microtime(true);
$function->execute();
$spendTime = microtime(true) - $startTime;
$spendTime = number_format($spendTime, 8);
SJB_Profiler::getInstance()->gatherFunctionInfo($module_name, $function_name, $spendTime);
} else {
$function->execute();
}
if (SJB_FlashMessages::getInstance()->isErrors()) {
$errors = SJB_FlashMessages::getInstance()->getErrorsAndRemove();
$function = $this->getFunctionForErrors($errors);
if ($function) {
ob_clean();
$function->execute();
SJB_Request::getInstance()->setPageTemplate('index.tpl');
}
}
$this->popExecutionStack();
$this->restoreEnvironment();
} else {
return "<!-- Either wrong module/function or function script file does not exist for {$module_name}, {$function_name} -->";
}
} else {
return "<!-- No such function or function is not accessible for {$module_name}, {$function_name} -->";
}
return ob_get_clean();
}