• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/marketplace/url.php
  • Класс: BitrixRestMarketplaceUrlsTemplates
  • Вызов: Templates::getDir
public function getDir()
	{
		if (null === self::$localDir)
		{
			self::$localDir = BitrixMainIOPath::DIRECTORY_SEPARATOR;
			$site = BitrixMainContext::getCurrent()->getSiteObject();
			if ($site && $site->getDir() != '')
			{
				$siteId = $site->getLid();
				$path = [BitrixMainSiteTable::getDocumentRoot($siteId), $site->getDir(), $this->directory];
				$dir = new BitrixMainIODirectory(BitrixMainIOPath::combine($path), $siteId);
				if ($dir->isExists())
				{
					self::$localDir = BitrixMainIOPath::combine([self::$localDir, $site->getDir()]);
				}
			}
		}
		$res = BitrixMainIOPath::combine([self::$localDir, $this->directory]);
		if (mb_substr($res, 0, -1) !== BitrixMainIOPath::DIRECTORY_SEPARATOR)
			$res .= BitrixMainIOPath::DIRECTORY_SEPARATOR;
		return $res;
	}