/** * Set input from custom input or stdin and return it * * @return string */ public static function getInput() { if ($input = self::$telegram->getCustomInput()) { self::setInputRaw($input); } else { self::setInputRaw(file_get_contents('php://input')); } self::log(self::$input); return self::$input; }
/** * Set input from custom input or stdin and return it * * @return string */ public static function getInput() { // First check if a custom input has been set, else get the PHP input. if (!($input = self::$telegram->getCustomInput())) { $input = file_get_contents('php://input'); } // Make sure we have a string to work with. if (is_string($input)) { self::$input = $input; } else { throw new TelegramException('Input must be a string!'); } TelegramLog::update(self::$input); return self::$input; }