本文整理汇总了PHP中Bootstrap::LoadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::LoadClass方法的具体用法?PHP Bootstrap::LoadClass怎么用?PHP Bootstrap::LoadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::LoadClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSystemConstants
/**
* Return the System defined constants and Application variables
* Constants: SYS_*
* Sessions : USER_* , URS_*
*/
public function getSystemConstants($params = null)
{
$t1 = Bootstrap::microtime_float();
$sysCon = array();
if (defined("SYS_LANG")) {
$sysCon["SYS_LANG"] = SYS_LANG;
}
if (defined("SYS_SKIN")) {
$sysCon["SYS_SKIN"] = SYS_SKIN;
}
if (defined("SYS_SYS")) {
$sysCon["SYS_SYS"] = SYS_SYS;
}
$sysCon["APPLICATION"] = isset($_SESSION["APPLICATION"]) ? $_SESSION["APPLICATION"] : "";
$sysCon["PROCESS"] = isset($_SESSION["PROCESS"]) ? $_SESSION["PROCESS"] : "";
$sysCon["TASK"] = isset($_SESSION["TASK"]) ? $_SESSION["TASK"] : "";
$sysCon["INDEX"] = isset($_SESSION["INDEX"]) ? $_SESSION["INDEX"] : "";
$sysCon["USER_LOGGED"] = isset($_SESSION["USER_LOGGED"]) ? $_SESSION["USER_LOGGED"] : "";
$sysCon["USR_USERNAME"] = isset($_SESSION["USR_USERNAME"]) ? $_SESSION["USR_USERNAME"] : "";
//###############################################################################################
// Added for compatibility betweek aplication called from web Entry that uses just WS functions
//###############################################################################################
if ($params != null) {
if (isset($params->option)) {
switch ($params->option) {
case "STORED SESSION":
if (isset($params->SID)) {
Bootstrap::LoadClass("sessions");
$oSessions = new Sessions($params->SID);
$sysCon = array_merge($sysCon, $oSessions->getGlobals());
}
break;
}
}
if (isset($params->appData) && is_array($params->appData)) {
$sysCon["APPLICATION"] = $params->appData["APPLICATION"];
$sysCon["PROCESS"] = $params->appData["PROCESS"];
$sysCon["TASK"] = $params->appData["TASK"];
$sysCon["INDEX"] = $params->appData["INDEX"];
if (empty($sysCon["USER_LOGGED"])) {
$sysCon["USER_LOGGED"] = $params->appData["USER_LOGGED"];
$sysCon["USR_USERNAME"] = $params->appData["USR_USERNAME"];
}
}
}
return $sysCon;
}
示例2: Sessions
$noLoginFiles[] = 'cases_NextStep';
$noLoginFiles[] = 'genericAjax';
$noLoginFiles[] = 'casesSaveDataView';
$noLoginFiles[] = 'propelTableAjax';
$noLoginFiles[] = 'licenseUpdate';
$noLoginFiles[] = 'casesStreamingFile';
$noLoginFolders[] = 'services';
$noLoginFolders[] = 'tracker';
$noLoginFolders[] = 'installer';
// This sentence is used when you lost the Session
if (! in_array( SYS_TARGET, $noLoginFiles ) && ! in_array( SYS_COLLECTION, $noLoginFolders ) && $bWE != true && $collectionPlugin != 'services') {
$bRedirect = true;
if (isset( $_GET['sid'] )) {
Bootstrap::LoadClass( 'sessions' );
$oSessions = new Sessions();
if ($aSession = $oSessions->verifySession( $_GET['sid'] )) {
$pathFile = $filter->validateInput('classes/model/Users.php','path');
require_once $pathFile;
$oUser = new Users();
$aUser = $oUser->load( $aSession['USR_UID'] );
$_SESSION['USER_LOGGED'] = $aUser['USR_UID'];
$_SESSION['USR_USERNAME'] = $aUser['USR_USERNAME'];
$bRedirect = false;
if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 ||
$config['ie_cookie_lifetime'] == 1) &&
(!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i", $_SERVER ['HTTP_USER_AGENT']) == 0) ||
$config['safari_cookie_lifetime'] == 1)) {
if (PHP_VERSION < 5.2) {
setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly');
示例3: processWorkspace
function processWorkspace()
{
try {
Bootstrap::LoadClass("plugin");
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if (file_exists(PATH_DATA_SITE . 'plugin.singleton')) {
$oPluginRegistry->unSerializeInstance(file_get_contents(PATH_DATA_SITE . 'plugin.singleton'));
}
Bootstrap::LoadClass("case");
global $sObject;
global $sLastExecution;
resendEmails();
unpauseApplications();
calculateDuration();
/*----------------------------------********---------------------------------*/
executeEvents($sLastExecution);
executeScheduledCases();
executeUpdateAppTitle();
executeCaseSelfService();
executePlugins();
/*----------------------------------********---------------------------------*/
} catch (Exception $oError) {
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
}
}
示例4: executePlugins
function executePlugins()
{
global $sFilter;
if ($sFilter != '' && strpos($sFilter, 'plugins') === false) {
return false;
}
$pathCronPlugins = PATH_CORE . 'bin' . PATH_SEP . 'plugins' . PATH_SEP;
// Executing cron files in bin/plugins directory
if (!is_dir($pathCronPlugins)) {
return false;
}
if ($handle = opendir($pathCronPlugins)) {
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . SYS_SYS);
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.php', 1) && is_file($pathCronPlugins . $file)) {
$filename = str_replace('.php', '', $file);
$className = $filename . 'ClassCron';
// Execute custom cron function
executeCustomCronFunction($pathCronPlugins . $file, $className);
}
}
}
// Executing registered cron files
// -> Get registered cron files
Bootstrap::LoadClass('plugin');
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if (file_exists(PATH_DATA_SITE . 'plugin.singleton')) {
$oPluginRegistry->unSerializeInstance(file_get_contents(PATH_DATA_SITE . 'plugin.singleton'));
}
$cronFiles = $oPluginRegistry->getCronFiles();
// -> Execute functions
if (!empty($cronFiles)) {
setExecutionMessage('Executing registered cron files for Workspace: ' . SYS_SYS);
foreach ($cronFiles as $cronFile) {
executeCustomCronFunction(PATH_PLUGINS . $cronFile->namespace . PATH_SEP . 'bin' . PATH_SEP . $cronFile->cronFile . '.php', $cronFile->cronFile);
}
}
}