Skip to content
This repository was archived by the owner on May 14, 2022. It is now read-only.

Commit 4667237

Browse files
committed
command-arguments can now be passed as additional method-arguments
1 parent e7705f1 commit 4667237

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Zyberspace/Telegram/Cli/RawClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ public function __destruct()
6262
/**
6363
* Executes a command on the telegram-cli. Line-breaks will be escaped, as telgram-cli does not support them.
6464
*
65-
* @param string $command The command, including all arguments
65+
* @param string $command The command. Command-arguments can be passed as additional method-arguments.
6666
*
6767
* @return object|boolean Returns the answer as a json-object or true on success, false if there was an error.
6868
*/
6969
public function exec($command)
7070
{
71+
$command = implode(' ', func_get_args());
72+
7173
fwrite($this->_fp, str_replace("\n", '\n', $command) . PHP_EOL);
7274

7375
$answer = fgets($this->_fp); //"ANSWER $bytes" if there is a return value or \n if not

0 commit comments

Comments
 (0)