• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/main.php
  • Класс: CAllMain
  • Вызов: CAllMain::InitDirProperties
public function InitDirProperties($path)
{
	self::InitPathVars($site, $path);

	$DOC_ROOT = CSite::GetSiteDocRoot($site);

	if($path === false)
		$path = $this->GetCurDir();
	if($site === false)
		$site = SITE_ID;

	if(isset($this->arDirProperties[$site][$path]))
		return true;

	$io = CBXVirtualIo::GetInstance();

	$dir = $path;
	while (true) // until the root
	{
		$dir = rtrim($dir, "/");
		$section_file_name = $DOC_ROOT.$dir."/.section.php";

		if($io->FileExists($section_file_name))
		{
			$arDirProperties = false;
			include($io->GetPhysicalName($section_file_name));
			if(is_array($arDirProperties))
			{
				foreach($arDirProperties as $prid=>$prval)
				{
					$prid = mb_strtoupper($prid);
					if(!isset($this->arDirProperties[$site][$path][$prid]))
						$this->arDirProperties[$site][$path][$prid] = $prval;
				}
			}
		}

		if($dir == '')
			break;

		// file or folder
		$pos = bxstrrpos($dir, "/");
		if($pos===false)
			break;

		//parent folder
		$dir = mb_substr($dir, 0, $pos + 1);
	}

	return true;
}