本文整理汇总了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>');
}
}
示例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);
}
}
示例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);
}