• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/main.php
  • Класс: CAllMain
  • Вызов: CAllMain::GetFileRecursive
public function GetFileRecursive($strFileName, $strDir=false)
{
	if($strDir === false)
		$strDir = $this->GetCurDir();

	$io = CBXVirtualIo::GetInstance();
	$fn = $io->CombinePath("/", $strDir, $strFileName);

	$p = null;
	while(!$io->FileExists($io->RelativeToAbsolutePath($fn)))
	{
		$p = bxstrrpos($strDir, "/");
		if($p === false)
			break;
		$strDir = mb_substr($strDir, 0, $p);
		$fn = $io->CombinePath("/", $strDir, $strFileName);
	}
	if($p === false)
		return false;

	return $fn;
}