Пример #1
0
 /**
  * Preprocessor for no-action
  *
  * @return void
  */
 protected function doNoAction()
 {
     $this->startTime = time();
     $this->startMemory = memory_get_usage(true);
     $this->memoryLimitIni = \XLite\Core\Converter::convertShortSize(ini_get('memory_limit') ?: '16M');
     foreach (\XLite\Core\Database::getRepo('XLite\\Model\\Task')->getCurrentQuery() as $task) {
         $task = $task[0];
         $runner = $task->getOwnerInstance();
         if ($runner) {
             $this->runRunner($runner);
         }
         sleep($this->sleepTime);
         if (!$this->checkThreadResource()) {
             $time = gmdate('H:i:s', time() - $this->startTime);
             $memory = \XLite\Core\Converter::formatFileSize(memory_get_usage(true));
             $this->printContent('Step is interrupted (time: ' . $time . '; memory usage: ' . $memory . ')');
             break;
         }
     }
 }
Пример #2
0
 protected function doNoAction()
 {
     $request = \XLite\Core\Request::getInstance();
     $server = $request->getServerData();
     $size = \XLite\Core\Converter::convertShortSize(ini_get('post_max_size'));
     if (isset($server['CONTENT_LENGTH']) && $server['CONTENT_LENGTH'] > $size) {
         \XLite\Core\TopMessage::addError('File size exceeds the maximum size', array('size' => \XLite\Core\Converter::convertShortSizeToHumanReadable($size)));
         $this->setReturnURL($this->getReferrerURL());
     }
 }