• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/export/exportfilesearch.php
  • Класс: BitrixTranslateControllerExportExportFileSearch
  • Вызов: ExportFileSearch::run
public function run(string $path = '', bool $runBefore = false): array
{
	if (empty($path))
	{
		$path = TranslateConfig::getDefaultPath();
	}

	if ($runBefore)
	{
		$this->onBeforeRun();
	}

	if ($this->isNewProcess)
	{
		$this->totalItems = (int)IndexFileIndexSearch::getCount($this->processFilter($path));
		$this->processedItems = 0;

		if ($this->totalItems > 0)
		{
			$this->exportFileName = $this->generateExportFileName($path, $this->languages);
			$csvFile = $this->createExportTempFile($this->exportFileName);
			$this->exportFilePath = $csvFile->getPhysicalPath();
			$this->exportFileSize = $csvFile->getSize();
		}
		if ($this->appendSamples)
		{
			$this->samplesFileName = $this->generateExportFileName($path.'-samples', $this->languages);
			$sampleFile = $this->createExportTempFile($this->samplesFileName);
			$this->samplesFilePath = $sampleFile->getPhysicalPath();
			$this->samplesFileSize = $sampleFile->getSize();
		}

		$this->saveProgressParameters();

		return [
			'STATUS' => ($this->totalItems > 0 ? TranslateControllerSTATUS_PROGRESS : TranslateControllerSTATUS_COMPLETED),
			'PROCESSED_ITEMS' => 0,
			'TOTAL_ITEMS' => $this->totalItems,
			'TOTAL_PHRASES' => $this->exportedPhraseCount,
			'TOTAL_SAMPLES' => $this->exportedSamplesCount,
		];
	}

	return $this->performStep('runExporting', ['path' => $path]);
}