예제 #1
0
파일: Terminus.php 프로젝트: RazzYoshi/cli
 /**
  * Set the outputter instance to a class property
  *
  * @param string $format Type of formatter to set on outputter
  * @return void
  */
 public static function setOutputter($format)
 {
     // Pick an output formatter
     if ($format == 'json') {
         $formatter = new Terminus\Outputters\JSONFormatter();
     } elseif ($format == 'bash') {
         $formatter = new Terminus\Outputters\BashFormatter();
     } else {
         $formatter = new Terminus\Outputters\PrettyFormatter();
     }
     // Create an output service.
     self::$outputter = new Terminus\Outputters\Outputter(new Terminus\Outputters\StreamWriter('php://stdout'), $formatter);
 }
예제 #2
0
 /**
  * Set the outputter instance.
  *
  * @param OutputterInterface $outputter
  */
 static function set_outputter($outputter)
 {
     self::$outputter = $outputter;
 }