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


PHP prado::setPathofAlias方法代碼示例

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


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

示例1: setUp

 public function setUp()
 {
     if (self::$app === null) {
         self::$app = new TApplication(dirname(__FILE__) . '/app');
         prado::setPathofAlias('App', dirname(__FILE__));
     }
     if (self::$config === null) {
         // Simulate a config file
         self::$config = new TXmlDocument('1.0', 'utf8');
         self::$config->loadFromString('<users><user name="Joe" password="demo"/><user name="John" password="demo" /><user name="test" password="test" roles="Reader, User"/><role name="Administrator" users="John" /><role name="Writer" users="Joe, John" /></users>');
     }
 }
開發者ID:Nurudeen,項目名稱:prado,代碼行數:12,代碼來源:TUserManagerTest.php

示例2: setUp

 public function setUp()
 {
     if (self::$app === null) {
         self::$app = new TApplication(dirname(__FILE__) . '/app');
         prado::setPathofAlias('App', dirname(__FILE__));
     }
     if (self::$mgr === null) {
         $config = new TXmlDocument('1.0', 'utf8');
         $config->loadFromString('<users><user name="Joe" password="demo"/><user name="John" password="demo" /><role name="Administrator" users="John" /><role name="Writer" users="Joe,John" /></users>');
         self::$mgr = new TUserManager();
         self::$mgr->init($config);
     }
 }
開發者ID:Nurudeen,項目名稱:prado,代碼行數:13,代碼來源:TUserTest.php

示例3: setUp

 public function setUp()
 {
     // Fake environment variables needed to determine path
     $_SERVER['HTTP_HOST'] = 'localhost';
     $_SERVER['SERVER_NAME'] = 'localhost';
     $_SERVER['SERVER_PORT'] = '80';
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $_SERVER['REQUEST_URI'] = '/demos/personal/index.php?page=Links';
     $_SERVER['SCRIPT_NAME'] = '/demos/personal/index.php';
     $_SERVER['PHP_SELF'] = '/demos/personal/index.php';
     $_SERVER['QUERY_STRING'] = 'page=Links';
     $_SERVER['SCRIPT_FILENAME'] = __FILE__;
     $_SERVER['PATH_INFO'] = __FILE__;
     $_SERVER['HTTP_REFERER'] = 'http://www.pradosoft.com';
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3';
     $_SERVER['REMOTE_HOST'] = 'localhost';
     if (self::$app === null) {
         self::$app = new TApplication(dirname(__FILE__) . '/app');
     }
     if (self::$assetDir === null) {
         self::$assetDir = dirname(__FILE__) . '/assets';
     }
     // Make asset directory if not exists
     if (!file_exists(self::$assetDir)) {
         if (is_writable(dirname(self::$assetDir))) {
             mkdir(self::$assetDir);
         } else {
             throw new Exception('Directory ' . dirname(self::$assetDir) . ' is not writable');
         }
     } elseif (!is_dir(self::$assetDir)) {
         throw new Exception(self::$assetDir . ' exists and is not a directory');
     }
     // Define an alias to asset directory
     prado::setPathofAlias('AssetAlias', self::$assetDir);
 }
開發者ID:ullasnaidu,項目名稱:epro,代碼行數:36,代碼來源:TAssetManagerTest.php


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