• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/util/process.php
  • Класс: BitrixTasksUtilProcess
  • Вызов: Process::__construct
public function __construct($options = array())
	{
		$this->time = isset($options['INITIAL_TIME']) ? intval($options['INITIAL_TIME']) : time();
		$this->options = $options;

		$stages = $this->getStages();
		if(!is_array($stages) || empty($stages))
		{
			throw new ArgumentException('Illegal description of stages');
		}

		$codeRegExp = '^[a-z0-9]{1}[a-z0-9_]{1,}$';
		$i = 0;
		foreach($stages as $code => $info)
		{
			if(!preg_match('#'.$codeRegExp.'#i', $code))
			{
				throw new ArgumentException('Illegal stage code: '.$code);
			}

			if(!is_callable(array($this, $code.'Action')))
			{
				throw new ArgumentException('No action callback for: '.$code);
			}

			$this->stageOrder[$i] = $code;

			$i++;
		}

		$this->stages = $stages;

		$this->errors = new ErrorCollection();

		$this->restore();

		if(isset($options['TIME_LIMIT']) && intval($options['TIME_LIMIT']))
		{
			$this->setTimeLimit(intval($options['TIME_LIMIT']));
		}

		$this->saveStartTime();
		$this->saveMemoryPeak();
	}