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. --- .../pheanstalk/src/Command/PauseTubeCommand.php | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/PauseTubeCommand.php (limited to 'intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/PauseTubeCommand.php') diff --git a/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/PauseTubeCommand.php b/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/PauseTubeCommand.php new file mode 100644 index 0000000..5483a1a --- /dev/null +++ b/intern.gospeladlershof.de/vendor/pda/pheanstalk/src/Command/PauseTubeCommand.php @@ -0,0 +1,62 @@ +_tube = $tube; + $this->_delay = $delay; + } + + /* (non-phpdoc) + * @see Command::getCommandLine() + */ + public function getCommandLine() + { + return sprintf( + 'pause-tube %s %u', + $this->_tube, + $this->_delay + ); + } + + /* (non-phpdoc) + * @see ResponseParser::parseResponse() + */ + public function parseResponse($responseLine, $responseData) + { + if ($responseLine == Response::RESPONSE_NOT_FOUND) { + throw new Exception\ServerException(sprintf( + '%s: tube %s does not exist.', + $responseLine, + $this->_tube + )); + } elseif ($responseLine == Response::RESPONSE_PAUSED) { + return $this->_createResponse(Response::RESPONSE_PAUSED); + } else { + throw new Exception('Unhandled response: '.$responseLine); + } + } +} -- cgit v1.2.3