Ejemplo n.º 1
0
 /**
  * ChallengeAbstract constructor.
  */
 public function __construct()
 {
     if (!Cli::isCli()) {
         throw new \DomainException('This challenge is supposed to be run from cli');
     }
     $this->solve();
 }
Ejemplo n.º 2
0
 /**
  * Dumps the message
  * 
  * @param string $str 
  * @return Logger
  */
 public function dump($str)
 {
     if (!empty($str)) {
         if (Cli::isCli()) {
             echo $str . "\n";
         } else {
             echo nl2br($str);
         }
         if ($this->_logToFile) {
             $this->log($str);
         }
         return $this;
     }
 }