本文整理汇总了PHP中Configuration::getAppConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::getAppConfig方法的具体用法?PHP Configuration::getAppConfig怎么用?PHP Configuration::getAppConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::getAppConfig方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteOldVersions
/**
* Deletes old versions that were never active
*/
public static function deleteOldVersions()
{
$config = Configuration::getAppConfig();
$dbObj = DBPool::getInstance();
$maxVersionCount = $config['max version count'];
$minVersionCount = $config['min version count'];
if ($maxVersionCount <= $dbObj->get_var("SELECT COUNT(1) FROM version WHERE active=false AND was_active=false")) {
$oldVersionsArray = array();
$oldVersions = $dbObj->get_results("SELECT id FROM version\n WHERE active=false AND was_active=false\n ORDER by id\n LIMIT " . ($maxVersionCount - $minVersionCount));
foreach ($oldVersions as $o) {
$oldVersionsArray[] = $o->id;
}
if (count($oldVersionsArray) > 0) {
$query = "DELETE FROM version WHERE id IN (" . implode(",", $oldVersionsArray) . ")";
$dbObj->query($query);
//Delete data from the disk
foreach ($oldVersionsArray as $version) {
$dataDirPath = Configuration::getBasePath() . "www/data/" . Util::XML_FILE . "/{$version}";
$imageDirPath = Configuration::getBasePath() . "www/data/" . Util::IMAGE_FILE . "/{$version}";
$changeDirPath = Configuration::getBasePath() . "www/data/" . Util::CHANGE_FILE . "/{$version}";
Util::deleteAll($dataDirPath);
Util::deleteAll($imageDirPath);
Util::deleteAll($changeDirPath);
}
$logger = Logger::getInstance();
$logStr = "Deleted versions " . implode(",", $oldVersionsArray);
$logger->log($logStr, Logger::INFO, Version::PACKAGE);
}
}
}
示例2: __construct
function __construct($agency, $xml)
{
$this->xml = $xml;
$this->agency = $agency;
$this->logger = Logger::getInstance();
$this->appConfig = Configuration::getAppConfig();
}
示例3: __construct
function __construct($agency, $xml)
{
$this->xml = $xml;
$this->agency = $agency;
$this->appConfig = Configuration::getAppConfig();
}
示例4: __construct
function __construct()
{
$this->appConfig = Configuration::getAppConfig();
}
示例5: __construct
function __construct(Agency $agency, SimpleXMLElement $xml)
{
$this->xml = $xml;
$this->agency = $agency;
$this->appConfig = Configuration::getAppConfig();
}
示例6: authCheck
public static function authCheck()
{
$config = Configuration::getAppConfig();
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != $config['user'] || $_SERVER['PHP_AUTH_PW'] != $config['password']) {
header("WWW-Authenticate: Basic realm=\"Transporter Admin Console Login\"");
header("HTTP/1.0 401 Unauthorized");
echo '<html><body>
<h1>Rejected!</h1>
<big>Wrong Username or Password!</big><br/> <br/>
<big>Refresh the page to continue...</big>
</body></html>';
exit;
}
}
示例7: __construct
function __construct($dataPath)
{
$this->dataPath = $dataPath;
$this->appConfig = Configuration::getAppConfig();
}
示例8: __construct
function __construct(Agency $agency)
{
$this->agency = $agency;
$this->appConfig = Configuration::getAppConfig();
}