Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/yandex.market/lib/salesboost/run/ |
Upload File : |
<?php namespace Yandex\Market\SalesBoost\Run; use Bitrix\Main; use Yandex\Market\Data; use Yandex\Market\SalesBoost; class Processor implements Data\Run\Processor { protected $setup; protected $parameters; /** @var Data\Run\Step[] */ protected $steps; protected $limitResource; public function __construct(array $parameters = []) { $this->parameters = $this->extendParameters($parameters); $this->steps = [ new Steps\Collector($this), new Steps\Planner($this), new Steps\Submitter($this), ]; $this->limitResource = new Data\Run\ResourceLimit([ 'startTime' => $this->parameter('startTime'), 'timeLimit' => $this->parameter('timeLimit') ]); } protected function extendParameters($parameters) { if (isset($parameters['initTime']) && $parameters['initTime'] instanceof Main\Type\DateTime) { $canonicalTime = Data\DateTime::toCanonical($parameters['initTime']); $canonicalTime->setDefaultTimeZone(); $parameters['initTimeUTC'] = $canonicalTime; } return $parameters; } public function steps() { return $this->steps; } public function run($action = self::ACTION_FULL) { $this->loadModules(); return $this->runStepper($action); } protected function loadModules() { if (!Main\Loader::includeModule('iblock')) { throw new Main\SystemException('cant load iblock module'); } } protected function runStepper($action) { $stepper = new Data\Run\Stepper($this->steps); return $stepper->process($action, $this->parameter('step'), $this->parameter('stepOffset')); } public function parameter($name, $default = null) { return isset($this->parameters[$name]) ? $this->parameters[$name] : $default; } public function isExpired() { $this->limitResource->tick(); return $this->limitResource->isExpired(); } }