Read input first char
@param string $message
@param bool   $nl
@return string
962224
public static function readFirst(string $message = '', bool $nl = false): string
    {
        return self::readChar($message, $nl);
    }
436285
public function Message($Message) {
   
      // htmlspecialchars_decode is being used here to revert any specialchar escaping done by Gdn_Format::Text()
      // which, untreated, would result in &#039; in the message in place of single quotes.
   
      if ($this->PhpMailer->ContentType == 'text/html') {
         $TextVersion = FALSE;
         if (stristr($Message, '<!-- //TEXT VERSION FOLLOWS//')) {
            $EmailParts = explode('<!-- //TEXT VERSION FOLLOWS//', $Message);
            $TextVersion = array_pop($EmailParts);
            $Message = array_shift($EmailParts);
            $TextVersion = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$TextVersion)));
            $Message = trim($Message);
         }
         
         $this->PhpMailer->MsgHTML(htmlspecialchars_decode($Message,ENT_QUOTES));
         if ($TextVersion !== FALSE && !empty($TextVersion)) {
            $TextVersion = html_entity_decode($TextVersion);
            $this->PhpMailer->AltBody = $TextVersion;
         }
      } else {
         $this->PhpMailer->Body = htmlspecialchars_decode($Message,ENT_QUOTES);
      }
      return $this;
   }
193189
public function read(string $question = '', bool $nl = false): string
    {
        if ($question) {
            \fwrite(\STDOUT, $question . ($nl ? "\n" : ''));
        }

        return \trim(\fgets($this->inputStream));
    }
445607
protected function prompt($message, $default = null, $hidden = false)
    {
        /** @var QuestionHelper $q */
        $q = $this->getHelperSet()->get('question');

        $question = new Question($message . ($default ? (sprintf(' [%s]', $default)) : '') . ' : ', $default);

        if (true === (bool)$hidden) {
            $question->setHidden($hidden);
        }

        $question->setValidator(function ($answer) {
            $len = function_exists('mb_strlen') ? mb_strlen($answer) : strlen($answer);

            if (0 === $len) {
                throw new \RuntimeException("You must enter a value", 23);
            }

            return $answer;
        });

        $question->setMaxAttempts(3);

        $response = $q->ask($this->getInput(), $this->getOutput(), $question);

        return $response;
    }
1280382
public function stderr(string $text = '', $nl = true): int
    {
        return Console::write($text, $nl, [
            'steam' => $this->errorStream,
        ]);
    }
243191
public function writeLn($message = '', $options = 0)
    {
        $this->write($message, $options);
        $this->write(PHP_EOL);

        return $this;
    }
1295906
public function read_message()
  {
    socket_recv ( $this->socket , $buf , 8 , MSG_WAITALL );
    if ($buf == null)
      return $buf;
    
    $frame_count = unpack("Nserial/Ncount", $buf);
    $frame_count = $frame_count["count"];
    $message = "";
    for ($i = 0; $i < $frame_count; $i++ ) {
      socket_recv ( $this->socket , $buf , 4 , MSG_WAITALL );
      $frame_size = unpack("Nsize", $buf);
      $frame_size = $frame_size["size"];
      if ($frame_size > 0) {
        socket_recv ( $this->socket , $bif , $frame_size , MSG_WAITALL );
        $message .= $bif;
      }
      
    }
    return $message;
  }
918354
public function decryptMessage($message)
    {
        $calgo = $this->config->getCipherAlgorithm();
        $cmode = $this->config->getCipherMode();
        $malgo = $this->config->getHmacAlgorithm();
        
        $size = mcrypt_get_iv_size($calgo, $cmode);
        $keySize = mcrypt_get_key_size($calgo, $cmode);
        $hmacSize = strlen(hash_hmac($malgo, '', 'foo-key', true));

        $cmac = substr($message, -1 * $hmacSize);
        $iv = substr($message, 0, $size);
        $cipherText = substr($message, $size, -1 * $hmacSize);
        $hmac = hash_hmac($malgo, $iv . $cipherText, $this->computeCipherKey($this->config->getHmacKey(), $hmacSize, $iv), true);
        
        if(!SecurityUtil::timingSafeEquals($hmac, $cmac))
        {
            throw new IntegrityCheckFailedException('Invalid encrypted input message detected');
        }
        
        $key = $this->computeCipherKey($this->config->getCipherKey(), $keySize, $iv);
        $data = mcrypt_decrypt($calgo, $key, $cipherText, $cmode, $iv);
        
        // PKCS7 Padding
        $pad = ord($data[strlen($data) - 1]);
        $data = substr($data, 0, -1 * $pad);
        
        // Remove zero-byte padding from the string.
        return $data;
    }
208467
public function startRead($message, array $options = null) {
		return $this->startEvent($message, ProfileInterface::TYPE_READ, $options);
	}
731078
final public static function firstCharacter($strString)
    {
        if (defined('QCUBED_ENCODING')) {
            if (mb_strlen($strString, QCUBED_ENCODING) > 0) {
                return mb_substr($strString, 0, 1, QCUBED_ENCODING);
            } else {
                return null;
            }
        } else {
            if (strlen($strString)) {
                return $strString[0];
            } else {
                return null;
            }
        }
    }
210723
private function summarize($message)
    {
        $message = ltrim($message, "\n");
        if ($newLinePos = strpos($message, "\n")) {
            $message = substr($message, 0, $newLinePos);
        }

        return rtrim($message);
    }
126596
public function digits($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return (strlen($val) === 0 || ctype_digit((string) $val));
                       }, $message);
        return $this;
    }
703183
private function _prepareMessage($message)
    {
        if (is_string($message) || is_numeric($message)) {
            return $message;
        }
        
        if (is_array($message)) {
            return json_encode($message, JSON_UNESCAPED_UNICODE);
        }
        
        return null;
    }
356322
final protected function error($message, $status = null, $nl = true)
    {
        $this->io->error($message, $status, $nl);
    }
362331
static function cli_read($format, $first = false)
    {
        $stdin = fopen('php://stdin', 'r');

        $result = fscanf($stdin, $format);

        if ($first) {
            return empty($result[0]) ? '' : $result[0];
        }

        return $result;
    }
717434
public function console($message, $eolBefor = false)
    {
        $befor = '';
        if ($eolBefor) {
            $befor = PHP_EOL;
        }

        echo $befor, $message, PHP_EOL;
        return $this;
    }
605076
protected function putln($prefix, $message)
    {
        switch ($prefix) {
            case '!':
                $prefix = "<error>$prefix</error>";
                break;
            case '*':
                $prefix = "<info>$prefix</info>";
                break;
            case '?':
                $prefix = "<comment>$prefix</comment>";
                break;
            case '-':
            case '+':
                $prefix = "  <comment>$prefix</comment>";
                break;
            case '>':
                $prefix = "    <comment>$prefix</comment>";
                break;
        }

        $this->verboseln("$prefix $message");
    }