Example #1
0
 public function testLoggingMethods()
 {
     Logger::emergency("Test logger!");
     Logger::alert("Test logger!");
     Logger::critical("Test logger!");
     Logger::error("Test logger!");
     Logger::warning("Test logger!");
     Logger::notice("Test logger!");
     Logger::info("Test logger!");
     Logger::debug("Test logger!");
     $this->assertStringEqualsFile(vfsStream::url("logs/file.log"), $this->log);
 }
Example #2
0
 private static function executeJob(Job $job)
 {
     self::$jobId = $job->getId();
     Logger::notice("Recived a new job #" . self::$jobId);
     //Store::getInstance()->markStarted(self::$jobId);
     if (!function_exists('pcntl_fork')) {
         self::runJob($job);
         Logger::notice("Job #" . self::$jobId . " exited.");
         return;
     }
     $pid = pcntl_fork();
     if ($pid) {
         pcntl_wait($status);
         Logger::notice("Job #" . self::$jobId . " exited.");
         //Store::getInstance()->markFinished(self::$jobId);
         //Store::reset();
     } else {
         self::runJob($job);
         die;
     }
 }