ProtocolInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis\Protocol;
  11. use Predis\Command\CommandInterface;
  12. use Predis\Connection\ComposableConnectionInterface;
  13. /**
  14. * Interface that defines a protocol processor that serializes Redis commands
  15. * and parses replies returned by the server to PHP objects.
  16. *
  17. * @author Daniele Alessandri <suppakilla@gmail.com>
  18. */
  19. interface ProtocolInterface extends ResponseReaderInterface
  20. {
  21. /**
  22. * Writes a Redis command on the specified connection.
  23. *
  24. * @param ComposableConnectionInterface $connection Connection to Redis.
  25. * @param CommandInterface $command Redis command.
  26. */
  27. public function write(ComposableConnectionInterface $connection, CommandInterface $command);
  28. /**
  29. * Sets the options for the protocol processor.
  30. *
  31. * @param string $option Name of the option.
  32. * @param mixed $value Value of the option.
  33. */
  34. public function setOption($option, $value);
  35. }