本文整理汇总了PHP中thebuggenie\core\framework\Settings::loadSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::loadSettings方法的具体用法?PHP Settings::loadSettings怎么用?PHP Settings::loadSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Settings
的用法示例。
在下文中一共展示了Settings::loadSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setScope
/**
* Find and set the current scope
*
* @param Scope $scope Specify a scope to set for this request
*/
public static function setScope($scope = null)
{
Logging::log("Setting current scope");
if ($scope !== null) {
Logging::log("Setting scope from function parameter");
self::$_scope = $scope;
Settings::forceSettingsReload();
Logging::log("...done (Setting scope from function parameter)");
return true;
}
$row = null;
try {
$hostname = null;
if (!self::isCLI() && !self::isInstallmode()) {
Logging::log("Checking if scope can be set from hostname (" . $_SERVER['HTTP_HOST'] . ")");
$hostname = $_SERVER['HTTP_HOST'];
}
if (!self::isUpgrademode() && !self::isInstallmode()) {
$scope = \thebuggenie\core\entities\tables\Scopes::getTable()->getByHostnameOrDefault($hostname);
}
if (!$scope instanceof Scope) {
Logging::log("It couldn't", 'main', Logging::LEVEL_WARNING);
if (!self::isInstallmode()) {
throw new \Exception("The Bug Genie isn't set up to work with this server name.");
} else {
return;
}
}
Logging::log("Setting scope {$scope->getID()} from hostname");
self::$_scope = $scope;
Settings::forceSettingsReload();
Settings::loadSettings();
Logging::log("...done (Setting scope from hostname)");
return true;
} catch (\Exception $e) {
if (self::isCLI()) {
Logging::log("Couldn't set up default scope.", 'main', Logging::LEVEL_FATAL);
throw new \Exception("Could not load default scope. Error message was: " . $e->getMessage());
} elseif (!self::isInstallmode()) {
Logging::log("Couldn't find a scope for hostname {$_SERVER['HTTP_HOST']}", 'main', Logging::LEVEL_FATAL);
Logging::log($e->getMessage(), 'main', Logging::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 {
Logging::log("Couldn't find a scope for hostname {$_SERVER['HTTP_HOST']}, but we're in installmode so continuing anyway");
}
}
}
示例2: loadFixtures
public function loadFixtures()
{
// Load initial settings
tables\Settings::getTable()->loadFixtures($this);
\thebuggenie\core\framework\Settings::loadSettings();
// Load group, users and permissions fixtures
Group::loadFixtures($this);
// Load initial teams
Team::loadFixtures($this);
// Set up user states, like "available", "away", etc
Userstate::loadFixtures($this);
// Set up data types
list($b_id, $f_id, $e_id, $t_id, $u_id, $i_id, $ep_id) = Issuetype::loadFixtures($this);
$scheme = IssuetypeScheme::loadFixtures($this);
tables\IssueFields::getTable()->loadFixtures($this, $scheme, $b_id, $f_id, $e_id, $t_id, $u_id, $i_id, $ep_id);
Datatype::loadFixtures($this);
// Set up workflows
Workflow::loadFixtures($this);
WorkflowScheme::loadFixtures($this);
tables\WorkflowIssuetype::getTable()->loadFixtures($this);
// Set up left menu links
tables\Links::getTable()->loadFixtures($this);
}