• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/cache_files_cleaner.php
  • Класс: CFileCacheCleaner
  • Вызов: CFileCacheCleaner::GetNextFile
function GetNextFile()
{
	if(is_object($this->_obFileTree))
	{
		$file = $this->_obFileTree->GetNextFile();
		//Check if current cache subdirectory cleaned
		if($file === false)
		{
			//Skip all checked bases
			$arPath = $this->_arPath;
			while(!empty($arPath))
			{
				$CurBase = array_shift($arPath);
				if($CurBase == $this->_CurrentBase)
					break;
			}
			//There is at least one cache directory not checked yet
			//so try to find a file inside
			while(!empty($arPath))
			{
				$this->_CurrentBase = array_shift($arPath);
				$this->_CurrentPath = "";
				$this->_obFileTree = new _CFileTree($_SERVER["DOCUMENT_ROOT"].$this->_CurrentBase);
				$this->_obFileTree->Start($this->_CurrentPath);
				$file = $this->_obFileTree->GetNextFile();
				if($file !== false)
					return $file;
			}
			return false;
		}
		return $file;
	}
	else
	{
		return false;
	}
}