• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/cache_files_cleaner.php
  • Класс: _CFileTree
  • Вызов: _CFileTree::GetNextFile
function GetNextFile()
{
	if(!is_array($this->_dir))
	{
		$this->_dir = $this->ReadDir($this->_path);
		if(!is_array($this->_dir))
			return false;
	}

	$next = current($this->_dir);
	next($this->_dir);

	if($next === false)
	{
		//try to go up dir tree
		if($this->GoUp())
			return $this->GetNextFile();
		else
			return false;
	}
	elseif(is_file($next))
	{
		//it's our target
		return $next;
	}
	else
	{
		//it's dir or link try to go deeper
		$this->_path = $next;
		$this->_dir = false;
		return true;
	}
}