當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Prado::setApplication方法代碼示例

本文整理匯總了PHP中Prado::setApplication方法的典型用法代碼示例。如果您正苦於以下問題:PHP Prado::setApplication方法的具體用法?PHP Prado::setApplication怎麽用?PHP Prado::setApplication使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Prado的用法示例。


在下文中一共展示了Prado::setApplication方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMysqlSqlMapManager

 protected function getMysqlSqlMapManager()
 {
     static $conn;
     static $sqlMapManager;
     if (Prado::getApplication() === null) {
         Prado::setApplication(new TApplication(dirname(__FILE__) . '/app'));
     }
     if ($conn === null) {
         $conn = new TDbConnection('mysql:host=localhost;dbname=prado_system_data_sqlmap', 'prado_unitest', 'prado_system_data_sqlmap_unitest');
     }
     $conn->setActive(true);
     if ($sqlMapManager === null) {
         $sqlMapManager = new TSqlMapManager($conn);
         $sqlMapManager->configureXml(dirname(__FILE__) . '/DynamicParameterTestMap.xml');
     }
     return $sqlMapManager;
 }
開發者ID:Nurudeen,項目名稱:prado,代碼行數:17,代碼來源:DynamicParameterTest.php

示例2: __construct

 public function __construct($basePath = 'protected', $cacheConfig = true, $configType = self::CONFIG_TYPE_XML)
 {
     Prado::setApplication($this);
     $this->setConfigurationType($configType);
     $this->resolvePaths($basePath);
     if ($cacheConfig) {
         $this->_cacheFile = $this->_runtimePath . DIRECTORY_SEPARATOR . self::CONFIGCACHE_FILE;
     }
     $this->_uniqueID = md5($this->_runtimePath);
     $this->_parameters = new TMap();
     $this->_services = array($this->getPageServiceID() => array('TPageService', array(), null));
     Prado::setPathOfAlias('Application', $this->_basePath);
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:13,代碼來源:pradolite.php

示例3: __construct

 /**
  * Constructor.
  * Sets application base path and initializes the application singleton.
  * Application base path refers to the root directory storing application
  * data and code not directly accessible by Web users.
  * By default, the base path is assumed to be the <b>protected</b>
  * directory under the directory containing the current running script.
  * @param string application base path or configuration file path.
  *        If the parameter is a file, it is assumed to be the application
  *        configuration file, and the directory containing the file is treated
  *        as the application base path.
  *        If it is a directory, it is assumed to be the application base path,
  *        and within that directory, a file named <b>application.xml</b>
  *        will be looked for. If found, the file is considered as the application
  *        configuration file.
  * @param boolean whether to cache application configuration. Defaults to true.
  * @throws TConfigurationException if configuration file cannot be read or the runtime path is invalid.
  */
 public function __construct($basePath = 'protected', $cacheConfig = true)
 {
     // register application as a singleton
     Prado::setApplication($this);
     $this->resolvePaths($basePath);
     if ($cacheConfig) {
         $this->_cacheFile = $this->_runtimePath . DIRECTORY_SEPARATOR . self::CONFIGCACHE_FILE;
     }
     // generates unique ID by hashing the runtime path
     $this->_uniqueID = md5($this->_runtimePath);
     $this->_parameters = new TMap();
     $this->_services = array($this->getPageServiceID() => array('TPageService', array(), null));
     Prado::setPathOfAlias('Application', $this->_basePath);
 }
開發者ID:BackupTheBerlios,項目名稱:horux-svn,代碼行數:32,代碼來源:TApplication.php


注:本文中的Prado::setApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。