• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/file.php
  • Класс: BitrixTranslateFile
  • Вызов: File::count
public function count($allowDirectFileAccess = false): int
{
	if ($this->messagesCount === null)
	{
		if ($this->messages !== null && count($this->messages) > 0)
		{
			$this->messagesCount = count($this->messages);
		}
		elseif ($allowDirectFileAccess)
		{
			$MESS = array();
			include $this->getPhysicalPath();

			if (is_array($MESS) && count($MESS) > 0)
			{
				$this->messagesCount = count($MESS);
			}
		}
	}

	return $this->messagesCount ?: 0;
}