From 95c15758b50144105064d2613d1e9a9da23d4e7c Mon Sep 17 00:00:00 2001 From: horus_arch Date: Mon, 20 Feb 2017 12:42:43 +0100 Subject: Committed vendor/ for lazyness. --- .../pda/pheanstalk/src/Command/IgnoreCommand.php | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/IgnoreCommand.php (limited to 'intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/IgnoreCommand.php') diff --git a/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/IgnoreCommand.php b/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/IgnoreCommand.php new file mode 100644 index 0000000..d596adb --- /dev/null +++ b/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/IgnoreCommand.php @@ -0,0 +1,54 @@ +_tube = $tube; + } + + /* (non-phpdoc) + * @see Command::getCommandLine() + */ + public function getCommandLine() + { + return 'ignore '.$this->_tube; + } + + /* (non-phpdoc) + * @see ResponseParser::parseResponse() + */ + public function parseResponse($responseLine, $responseData) + { + if (preg_match('#^WATCHING (\d+)$#', $responseLine, $matches)) { + return $this->_createResponse('WATCHING', array( + 'count' => (int) $matches[1] + )); + } elseif ($responseLine == Response::RESPONSE_NOT_IGNORED) { + throw new Exception\ServerException($responseLine . + ': cannot ignore last tube in watchlist'); + } else { + throw new Exception('Unhandled response: '.$responseLine); + } + } +} -- cgit v1.2.3