本文整理匯總了PHP中Bitrix\Main\IO\Path::convertRelativeToAbsolute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Path::convertRelativeToAbsolute方法的具體用法?PHP Path::convertRelativeToAbsolute怎麽用?PHP Path::convertRelativeToAbsolute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bitrix\Main\IO\Path
的用法示例。
在下文中一共展示了Path::convertRelativeToAbsolute方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isRequestedUriExists
private function isRequestedUriExists()
{
/** @var $request HttpRequest */
$request = $this->getContext()->getRequest();
$absUrl = IO\Path::convertRelativeToAbsolute($request->getRequestedPage());
return IO\File::isFileExists($absUrl);
}
示例2: renderExceptionMessage
function renderExceptionMessage(\Exception $exception, $debug = false)
{
if ($debug) {
echo ExceptionHandlerFormatter::format($exception, true);
} else {
$p = Main\IO\Path::convertRelativeToAbsolute("/error.php");
if (Main\IO\File::isFileExists($p)) {
include $p;
} else {
$context = Main\Application::getInstance();
if ($context) {
echo Main\Localization\Loc::getMessage("eho_render_exception_message");
} else {
echo "A error occurred during execution of this script. You can turn on extended error reporting in .settings.php file.";
}
}
}
}
示例3: transferUri
private function transferUri($url)
{
$url = IO\Path::normalize($url);
$urlTmp = trim($url, " \t\n\r\v\\/");
if (empty($urlTmp)) {
throw new ArgumentNullException("url");
}
$ext = IO\Path::getExtension($url);
if (strtolower($ext) != "php") {
throw new SystemException("Only php files are allowable for url rewriting");
}
$arUrl = explode("/", $url);
$rootDirName = "";
while (!empty($arUrl) && ($rootDirName = array_shift($arUrl)) === "") {
}
$rootDirName = strtolower(str_replace(".", "", $rootDirName));
if (in_array($rootDirName, array("bitrix", "local", "upload"))) {
throw new SystemException(sprintf("Can not use path '%s' for url rewriting", $url));
}
if (!IO\Path::validate($url)) {
throw new SystemException(sprintf("Path '%s' is not valid", $url));
}
$absUrl = IO\Path::convertRelativeToAbsolute($url);
if (!IO\File::isFileExists($absUrl)) {
throw new SystemException(sprintf("Path '%s' is not found", $url));
}
$absUrlPhysical = IO\Path::convertLogicalToPhysical($absUrl);
global $APPLICATION, $USER, $DB;
include_once $absUrlPhysical;
die;
}
示例4: loadTriggers
private static function loadTriggers($moduleId)
{
static $triggersCache = array();
if (isset($triggersCache[$moduleId])) {
return;
}
if (!IO\Path::validateFilename($moduleId)) {
throw new Main\ArgumentOutOfRangeException("moduleId");
}
$triggersCache[$moduleId] = true;
$path = IO\Path::convertRelativeToAbsolute("/bitrix/modules/" . $moduleId . "/option_triggers.php");
if (!IO\File::isFileExists($path)) {
return;
}
include IO\Path::convertLogicalToPhysical($path);
}
示例5: searchConnectionParametersByName
/**
* Search connection parameters (type, host, db, login and password) by connection name
*
* @param string $name Connection name
* @return array('type' => string, 'host' => string, 'db_name' => string, 'login' => string, 'password' => string, "init_command" => string, "options" => string)|null
* @throws \Bitrix\Main\ArgumentTypeException
* @throws \Bitrix\Main\ArgumentNullException
*/
private function searchConnectionParametersByName($name)
{
if (!is_string($name)) {
throw new \Bitrix\Main\ArgumentTypeException("name", "string");
}
if ($name === "") {
throw new \Bitrix\Main\ArgumentNullException("name");
}
if ($name === self::DEFAULT_CONNECTION) {
$v = \Bitrix\Main\Config\Configuration::getValue(self::DEFAULT_CONNECTION_CONFIGURATION);
if ($v != null) {
return $v;
}
$DBType = "";
$DBHost = "";
$DBName = "";
$DBLogin = "";
$DBPassword = "";
include \Bitrix\Main\IO\Path::convertRelativeToAbsolute("/bitrix/php_interface/dbconn.php");
return array("type" => $DBType, "host" => $DBHost, "db_name" => $DBName, "login" => $DBLogin, "password" => $DBPassword);
}
/* TODO: реализовать */
return null;
}
示例6: includeConfiguration
/**
* Reads the configuration.
*
* @return array
*/
public function includeConfiguration()
{
if (!isset($this->options)) {
$arHTMLPagesOptions = array();
$configurationPath = Main\IO\Path::convertRelativeToAbsolute(Main\Application::getPersonalRoot() . "/html_pages/.config.php");
if (file_exists($configurationPath)) {
include $configurationPath;
}
$this->options = $arHTMLPagesOptions;
}
return $this->options;
}
示例7: __construct
public function __construct($cacheKey, array $configuration, array $htmlCacheOptions)
{
parent::__construct($cacheKey, $configuration, $htmlCacheOptions);
$this->cacheFile = new Main\IO\File(Main\IO\Path::convertRelativeToAbsolute(Main\Application::getPersonalRoot() . "/html_pages" . $this->cacheKey));
}