本文整理汇总了PHP中Bootstrap::LoadSystem方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::LoadSystem方法的具体用法?PHP Bootstrap::LoadSystem怎么用?PHP Bootstrap::LoadSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::LoadSystem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgradeCacheView
/**
* Upgrade the AppCacheView table to the latest system version.
*
* This recreates the table and populates with data.
*
* @param bool $checkOnly only check if the upgrade is needed if true
* @param string $lang not currently used
*/
public function upgradeCacheView($fill = true, $checkOnly = false, $lang = "en")
{
$this->initPropel(true);
//require_once ('classes/model/AppCacheView.php');
//check the language, if no info in config about language, the default is 'en'
G::LoadClass("configuration");
$oConf = new Configurations();
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
$appCacheViewEngine = $oConf->aConfig;
//setup the appcacheview object, and the path for the sql files
$appCache = new AppCacheView();
$appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
$userGrants = $appCache->checkGrantsForUser(false);
$currentUser = $userGrants['user'];
$currentUserIsSuper = $userGrants['super'];
//if user does not have the SUPER privilege we need to use the root user and grant the SUPER priv. to normal user.
if (!$currentUserIsSuper) {
$appCache->checkGrantsForUser(true);
$appCache->setSuperForUser($currentUser);
$currentUserIsSuper = true;
}
CLI::logging("-> Creating tables \n");
//now check if table APPCACHEVIEW exists, and it have correct number of fields, etc.
$res = $appCache->checkAppCacheView();
CLI::logging("-> Update DEL_LAST_INDEX field in APP_DELEGATION table \n");
//Update APP_DELEGATION.DEL_LAST_INDEX data
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
CLI::logging("-> Verifying roles permissions in RBAC \n");
//Update table RBAC permissions
Bootstrap::LoadSystem( 'rbac' );
$RBAC = & RBAC::getSingleton();
$RBAC->initRBAC();
$result = $RBAC->verifyPermissions();
//.........这里部分代码省略.........
示例2: fopen
}
$pro['datasources']['workflow']['connection'] = $dsn;
$pro['datasources']['workflow']['adapter'] = $DB_ADAPTER;
$pro['datasources']['rbac']['connection'] = $dsnRbac;
$pro['datasources']['rbac']['adapter'] = $DB_ADAPTER;
$pro['datasources']['rp']['connection'] = $dsnRp;
$pro['datasources']['rp']['adapter'] = $DB_ADAPTER;
//$pro['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
//$pro['datasources']['dbarray']['adapter'] = 'dbarray';
$oFile = fopen(PATH_CORE . 'config/_databases_.php', 'w');
fwrite($oFile, '<?php global $pro;return $pro; ?>');
fclose($oFile);
Propel::init(PATH_CORE . 'config/_databases_.php');
//Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
// enable rbac
Bootstrap::LoadSystem('rbac');
$RBAC =& RBAC::getSingleton(PATH_DATA, session_id());
$RBAC->sSystem = 'PROCESSMAKER';
eprintln("Processing workspace: " . $sObject, "green");
try {
processWorkspace();
} catch (Exception $e) {
echo $e->getMessage();
eprintln("Probelm in workspace: " . $sObject . " it was omitted.", "red");
}
eprintln();
}
}
unlink(PATH_CORE . 'config/_databases_.php');
} else {
processWorkspace();
示例3: upgradeCacheView
/**
* Upgrade the AppCacheView table to the latest system version.
*
* This recreates the table and populates with data.
*
* @param bool $checkOnly only check if the upgrade is needed if true
* @param string $lang not currently used
*/
public function upgradeCacheView($fill = true, $checkOnly = false, $lang = "en")
{
$this->initPropel(true);
//require_once ('classes/model/AppCacheView.php');
//check the language, if no info in config about language, the default is 'en'
G::LoadClass("configuration");
$oConf = new Configurations();
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
$appCacheViewEngine = $oConf->aConfig;
//setup the appcacheview object, and the path for the sql files
$appCache = new AppCacheView();
$appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
$userGrants = $appCache->checkGrantsForUser(false);
$currentUser = $userGrants['user'];
$currentUserIsSuper = $userGrants['super'];
//if user does not have the SUPER privilege we need to use the root user and grant the SUPER priv. to normal user.
if (!$currentUserIsSuper) {
$appCache->checkGrantsForUser(true);
$appCache->setSuperForUser($currentUser);
$currentUserIsSuper = true;
}
CLI::logging("-> Creating table\n");
//now check if table APPCACHEVIEW exists, and it have correct number of fields, etc.
$res = $appCache->checkAppCacheView();
CLI::logging("-> Update DEL_LAST_INDEX field in APP_DELEGATION table\n");
//Update APP_DELEGATION.DEL_LAST_INDEX data
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
CLI::logging("-> Verifying roles permissions in RBAC \n");
//Update table RBAC permissions
Bootstrap::LoadSystem('rbac');
$RBAC =& RBAC::getSingleton();
$RBAC->initRBAC();
$result = $RBAC->verifyPermissions();
if (count($result) > 1) {
foreach ($result as $item) {
CLI::logging(" {$item}... \n");
}
} else {
CLI::logging(" All roles permissions already updated \n");
}
CLI::logging("-> Creating triggers\n");
//now check if we have the triggers installed
$triggers = array();
$triggers[] = $appCache->triggerAppDelegationInsert($lang, $checkOnly);
$triggers[] = $appCache->triggerAppDelegationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationDelete($lang, $checkOnly);
$triggers[] = $appCache->triggerSubApplicationInsert($lang, $checkOnly);
$triggers[] = $appCache->triggerContentUpdate($lang, $checkOnly);
if ($fill) {
CLI::logging("-> Rebuild Cache View with language {$lang}...\n");
//build using the method in AppCacheView Class
$res = $appCache->fillAppCacheView($lang);
//set status in config table
$confParams = array('LANG' => $lang, 'STATUS' => 'active');
}
$oConf->aConfig = $confParams;
$oConf->saveConfig('APP_CACHE_VIEW_ENGINE', '', '', '');
// removing casesList configuration records. TODO: removing these lines that resets all the configurations records
$oCriteria = new Criteria();
$oCriteria->add(ConfigurationPeer::CFG_UID, "casesList");
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
ConfigurationPeer::doDelete($oCriteria);
// end of reset
}
示例4: LoadClass
/**
* If the class is not defined by the aplication, it
* attempt to load the class from gulliver.system
*
* @author Fernando Ontiveros Lira <fernando@colosa.com>, David S. Callizaya
* @access public
* @param string $strClass
* @return void
*/
public static function LoadClass($strClass)
{
Bootstrap::LoadSystem('inputfilter');
$filter = new InputFilter();
$path = PATH_GULLIVER . 'class.' . $strClass . '.php';
$path = $filter->validateInput($path, "path");
$classfile = Bootstrap::ExpandPath("classes") . 'class.' . $strClass . '.php';
$classfile = $filter->validateInput($classfile, "path");
if (!file_exists($classfile)) {
if (file_exists($path)) {
return require_once $path;
} else {
return false;
}
} else {
return require_once $classfile;
}
}
示例5: array
$pro = array();
$pro["datasources"]["workflow"]["connection"] = $dsn;
$pro["datasources"]["workflow"]["adapter"] = $DB_ADAPTER;
$pro["datasources"]["rbac"]["connection"] = $dsnRbac;
$pro["datasources"]["rbac"]["adapter"] = $DB_ADAPTER;
$pro["datasources"]["rp"]["connection"] = $dsnRp;
$pro["datasources"]["rp"]["adapter"] = $DB_ADAPTER;
//$pro["datasources"]["dbarray"]["connection"] = "dbarray://user:pass@localhost/pm_os";
//$pro["datasources"]["dbarray"]["adapter"] = "dbarray";
$oFile = fopen(PATH_CORE . "config" . PATH_SEP . "_databases_.php", "w");
fwrite($oFile, "<?php global \$pro; return \$pro; ?>");
fclose($oFile);
Propel::init(PATH_CORE . "config" . PATH_SEP . "_databases_.php");
//Creole::registerDriver("dbarray", "creole.contrib.DBArrayConnection");
//Enable RBAC
Bootstrap::LoadSystem("rbac");
$rbac =& RBAC::getSingleton(PATH_DATA, session_id());
$rbac->sSystem = "PROCESSMAKER";
if (!defined("DB_ADAPTER")) {
define("DB_ADAPTER", $DB_ADAPTER);
}
eprintln("Processing workspace: " . $workflow, "green");
try {
$timerEvent = new \ProcessMaker\BusinessModel\TimerEvent();
$timerEvent->startContinueCaseByTimerEvent(date("Y-m-d H:i:s"), true);
} catch (Exception $e) {
echo $e->getMessage() . "\n";
eprintln("Problem in workspace: " . $workflow . " it was omitted.", "red");
}
eprintln();
}