Anticipating update in code rather than in docs (fix is trivial and BC will be honored) this class serves as adapter until this moment comes.
Author: Victor Farazdagi
Example #1
0
 /**
  * Writes the message $msg to STDERR.
  *
  * @param string $msg The message to output
  * @param string $status Output status
  *
  * @return \Phrozn\Outputter
  */
 public function stderr($msg, $status = self::STATUS_FAIL)
 {
     if (defined('STDERR')) {
         fwrite(STDERR, $msg);
     } else {
         $msg = Color::strip(Color::convert($msg));
         $this->lines[] = trim($msg);
     }
     return $this;
 }
Example #2
0
 /**
  * Writes the message $msg to STDERR.
  *
  * @param string $msg The message to output
  * @param string $status Output status
  *
  * @return \Phrozn\Outputter
  */
 public function stderr($msg, $status = self::STATUS_FAIL)
 {
     $msg = Color::convert($status . $msg . "\n");
     if (defined('STDERR')) {
         fwrite(STDERR, $msg);
     } else {
         echo $msg;
         if (count(\ob_get_status()) !== 0) {
             ob_flush();
         }
     }
     return $this;
 }
Example #3
0
 protected function pad($str)
 {
     return str_repeat(' ', strlen(Color::strip(Color::convert($str))));
 }