out() public static method

This method is used to send some text to STDOUT, maybe with some color
public static out ( string $string, string $color = 'white' ) : void
$string string the text to be sent to STDOUT
$color string the color to colorize your text
return void
コード例 #1
0
ファイル: Sender.php プロジェクト: gabrielrcouto/php-gui
 /**
  * Print debug information
  *
  * @param String $text Text to print
  *
  * @return void
  */
 protected function out($text)
 {
     if ($this->application->getVerboseLevel() == 2) {
         $re = explode('}{', $text);
         foreach ($re as $key => $value) {
             if (count($re) > 1 && $key == 0) {
                 Output::out('=> Sent: ' . $value . '}', 'yellow');
             } elseif (count($re) > 1 && $key == count($re) - 1) {
                 Output::out('=> Sent: {' . $value, 'yellow');
             } elseif (count($re) > 1) {
                 Output::out('=> Sent: {' . $value . '}', 'yellow');
             } else {
                 Output::out('=> Sent: ' . $value, 'yellow');
             }
         }
     }
 }
コード例 #2
0
ファイル: Receiver.php プロジェクト: gabrielrcouto/php-gui
 /**
  * Parse a debug message
  *
  * @param $message Message
  *
  * @return void
  */
 protected function parseDebug($message)
 {
     if ($this->application->getVerboseLevel() == 2) {
         Output::out('<= Debug: ' . json_encode($message), 'blue');
     }
 }