本文整理汇总了PHP中Engine::getRemoteDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine::getRemoteDir方法的具体用法?PHP Engine::getRemoteDir怎么用?PHP Engine::getRemoteDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::getRemoteDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCSSAndJSDependencies
public final function getCSSAndJSDependencies($appendTemplateDefaultPublicDirectory = true)
{
$values = array();
foreach ($this->CSS as $value) {
$url = strpos($value, "http://") > -1 || strpos($value, "https://") > -1 ? $value : Engine::getRemoteDir($appendTemplateDefaultPublicDirectory ? $this->getLocalDir() . '/public/' . $value : $value);
array_push($values, "<link href='" . $url . "' rel='stylesheet' type='text/css'/>");
}
foreach ($this->JS as $value) {
$url = strpos($value, "http:") > -1 || strpos($value, "https://") > -1 ? $value : Engine::getRemoteDir($appendTemplateDefaultPublicDirectory ? $this->getLocalDir() . '/public/' . $value : $value);
array_push($values, "<script src='" . $url . "'></script>");
}
return $values;
}
示例2: test_getRemoteDir
public function test_getRemoteDir()
{
/*
This unit test is against the filepath of the engine.
This is so that the function gives us a relative URL
rather than a filepath, this then allows us to transform
paths such as CSS etc to their correct local on a website.
With the assistance of getRemoteAbsolutePath, we can get
the server address and also the virtualhost address if there
is one. (e.g. Cardiff Uni project server use your email username,
in other words, mine is /JamesM27 on the project.cs.cf.ac.uk domain
however, without this fix, apache treats the folder as root, i.e. "/").
*/
//Remove the unit test folder for our actual document path
$_SERVER['DOCUMENT_ROOT'] = realpath(__DIR__ . '../');
//Pretend we are a web server running index.php to set our environment
$_SERVER["PHP_SELF"] = "/index.php";
$this->assertEquals("/", Engine::getRemoteDir("/"));
//Test against a realworld scenario, i.e. our actual file path.
$this->assertEquals("/home", Engine::getRemoteDir(__DIR__ . "/home"));
}
示例3: onSubmit
public function onSubmit()
{
rename(TEMP_CONFIG_FILE, CONFIG_FILE);
$this->sendStatus(false, Engine::getRemoteDir($_SERVER['REQUEST_URI']));
}