本文整理汇总了PHP中TBGSettings::loadSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGSettings::loadSettings方法的具体用法?PHP TBGSettings::loadSettings怎么用?PHP TBGSettings::loadSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::loadSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFixtures
public function loadFixtures()
{
// Load initial settings
TBGSettingsTable::getTable()->loadFixtures($this);
TBGSettings::loadSettings();
// Load group, users and permissions fixtures
TBGGroup::loadFixtures($this);
// Load initial teams
TBGTeam::loadFixtures($this);
// Set up user states, like "available", "away", etc
TBGUserstate::loadFixtures($this);
// Set up data types
list($b_id, $f_id, $e_id, $t_id, $u_id, $i_id) = TBGIssuetype::loadFixtures($this);
$scheme = TBGIssuetypeScheme::loadFixtures($this);
TBGIssueFieldsTable::getTable()->loadFixtures($this, $scheme, $b_id, $f_id, $e_id, $t_id, $u_id, $i_id);
TBGDatatype::loadFixtures($this);
// Set up workflows
TBGWorkflow::loadFixtures($this);
TBGWorkflowSchemesTable::getTable()->loadFixtures($this);
TBGWorkflowIssuetypeTable::getTable()->loadFixtures($this);
// Set up left menu links
TBGLinksTable::getTable()->loadFixtures($this);
}
示例2: setScope
/**
* Find and set the current scope
*
* @param integer $scope Specify a scope to set for this request
*/
public static function setScope($scope = null)
{
TBGLogging::log("Setting current scope");
if ($scope !== null) {
TBGLogging::log("Setting scope from function parameter");
self::$_scope = $scope;
TBGSettings::forceSettingsReload();
TBGLogging::log("...done (Setting scope from function parameter)");
return true;
}
$row = null;
try {
$hostname = null;
if (!self::isCLI() && !self::isInstallmode()) {
TBGLogging::log("Checking if scope can be set from hostname (" . $_SERVER['HTTP_HOST'] . ")");
$hostname = $_SERVER['HTTP_HOST'];
}
if (!self::isUpgrademode() && !self::isInstallmode()) {
$row = TBGScopesTable::getTable()->getByHostnameOrDefault($hostname);
}
if (!$row instanceof B2DBRow) {
TBGLogging::log("It couldn't", 'main', TBGLogging::LEVEL_WARNING);
if (!self::isInstallmode()) {
throw new Exception("The Bug Genie isn't set up to work with this server name.");
} else {
return;
}
}
TBGLogging::log("Setting scope from hostname");
self::$_scope = TBGContext::factory()->TBGScope($row->get(TBGScopesTable::ID), $row);
TBGSettings::forceSettingsReload();
TBGSettings::loadSettings();
TBGLogging::log("...done (Setting scope from hostname)");
return true;
} catch (Exception $e) {
if (self::isCLI()) {
TBGLogging::log("Couldn't set up default scope.", 'main', TBGLogging::LEVEL_FATAL);
throw new Exception("Could not load default scope. Error message was: " . $e->getMessage());
} elseif (!self::isInstallmode()) {
throw $e;
TBGLogging::log("Couldn't find a scope for hostname {$_SERVER['HTTP_HOST']}", 'main', TBGLogging::LEVEL_FATAL);
TBGLogging::log($e->getMessage(), 'main', TBGLogging::LEVEL_FATAL);
throw new Exception("Could not load scope. This is usually because the scopes table doesn't have a scope for this hostname");
} else {
TBGLogging::log("Couldn't find a scope for hostname {$_SERVER['HTTP_HOST']}, but we're in installmode so continuing anyway");
}
}
}