当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::getAppConfig方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:33,代码来源:Version.php

示例2: __construct

 function __construct($agency, $xml)
 {
     $this->xml = $xml;
     $this->agency = $agency;
     $this->logger = Logger::getInstance();
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:7,代码来源:NxtbusStop.php

示例3: __construct

 function __construct($agency, $xml)
 {
     $this->xml = $xml;
     $this->agency = $agency;
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:6,代码来源:NxtbusDirection.php

示例4: __construct

 function __construct()
 {
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:4,代码来源:BartXmlObjBuilder.php

示例5: __construct

 function __construct(Agency $agency, SimpleXMLElement $xml)
 {
     $this->xml = $xml;
     $this->agency = $agency;
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:6,代码来源:NxtbusRoute.php

示例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/>&nbsp;<br/>&nbsp;
             <big>Refresh the page to continue...</big>
             </body></html>';
         exit;
     }
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:14,代码来源:Util.php

示例7: __construct

 function __construct($dataPath)
 {
     $this->dataPath = $dataPath;
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:5,代码来源:XmlObjBuilder.php

示例8: __construct

 function __construct(Agency $agency)
 {
     $this->agency = $agency;
     $this->appConfig = Configuration::getAppConfig();
 }
开发者ID:nikhilpatel1989,项目名称:Transporter-Server,代码行数:5,代码来源:BartStopDirMap.php


注:本文中的Configuration::getAppConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。