示例#1
0
 /**
  * @test
  * @dataProvider enrichLogDataByComponentEnrichesDataArrayDataProvider
  *
  * @param integer $userId
  * @param string $component
  * @param array $expected
  */
 public function enrichLogDataByComponentEnrichesDataArray($userId, $component, $expected)
 {
     $actual = array();
     $GLOBALS['TSFE']->fe_user->user['uid'] = $userId;
     $this->proxy->enrichLogDataByComponent($actual, $component);
     $this->assertEquals($expected, $actual);
 }
 /**
  * @return ObjectStorage
  */
 public function getResult()
 {
     if (count($this->result) === 0) {
         $this->logger->info(sprintf("Command result size is %s bytes", strlen($this->rawResult)), __CLASS__);
         $this->buildResult();
     }
     return $this->result;
 }
示例#3
0
 /**
  * Executes the wget command
  *
  * @return string
  */
 public function execute()
 {
     $command = $this->buildCommand();
     TimeTracker::start($command);
     $this->logger->debug('Executing WGet command ' . $command, __CLASS__);
     exec($command, $outputLines, $returnVar);
     $this->logger->debug('Called WGet command returned status ' . $returnVar, __CLASS__, array('time' => TimeTracker::stop($command)));
     return implode('\\n', $outputLines);
 }
 /**
  * @param mixed $error
  * @return void
  */
 protected function handleError($error)
 {
     if ($error instanceof Error) {
         $this->logger->error(sprintf('%s (%s)', $error->getMessage(), $error->getCode()));
         echo $error->getCode();
     } else {
         $this->logger->error('Unknown Error while dispatching the controller action. (1400683671)', get_class($this));
         echo 1400683671;
     }
 }
 /**
  * @return string
  */
 protected function executeCommandLineOnShell()
 {
     $this->logger->debug(sprintf("Running command %s", $this->commandLine), __CLASS__);
     $this->shellCommandService->setRedirectStandardErrorToStandardOut(true);
     return $this->shellCommandService->execute($this->commandLine);
 }
 /**
  * @return void
  */
 protected function checkResult()
 {
     if ($this->exitCode !== 0) {
         $this->logger->error(sprintf("Shell command \"%s\" returned exist status %s", $this->command, $this->exitCode), __CLASS__);
     }
 }
 /**
  * @return void
  */
 protected function logToApplicationLog()
 {
     $data = array();
     $this->addTaskLoggerData($data);
     $this->logger->info(sprintf('Scheduler Task "%s" completed.', trim($this->getTaskTitle())), get_class($this), $data);
 }