• Модуль: advertising
  • Путь к файлу: ~/bitrix/modules/advertising/classes/general/advertising.php
  • Класс: CAdvBanner_all
  • Вызов: CAdvBanner_all::makeFileArrayFromPath
static function makeFileArrayFromPath($file_path, $description = null, $options = array())
{
	/** @global CMain $APPLICATION */
	global $APPLICATION;
	$result = false;

	if (preg_match("/^https?:\/\//", $file_path))
	{
		$result = CFile::MakeFileArray($file_path);
	}
	else
	{
		$io = CBXVirtualIo::GetInstance();
		$normPath = $io->CombinePath("/", $file_path);
		$absPath = $io->CombinePath($_SERVER["DOCUMENT_ROOT"], $normPath);
		if ($io->ValidatePathString($absPath) && $io->FileExists($absPath))
		{
			$perm = $APPLICATION->GetFileAccessPermission($normPath);
			if ($perm >= "W")
				$result = CFile::MakeFileArray($io->GetPhysicalName($absPath));
		}
	}

	if (is_array($result))
	{
		if (!is_null($description))
			$result["description"] = $description;
	}

	return $result;
}