ServerProfileInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\Profile;
  11. use Predis\Command\CommandInterface;
  12. /**
  13. * A server profile defines features and commands supported by certain
  14. * versions of Redis. Instances of Predis\Client should use a server
  15. * profile matching the version of Redis in use.
  16. *
  17. * @author Daniele Alessandri <suppakilla@gmail.com>
  18. */
  19. interface ServerProfileInterface
  20. {
  21. /**
  22. * Gets a profile version corresponding to a Redis version.
  23. *
  24. * @return string
  25. */
  26. public function getVersion();
  27. /**
  28. * Checks if the profile supports the specified command.
  29. *
  30. * @param string $command Command ID.
  31. * @return bool
  32. */
  33. public function supportsCommand($command);
  34. /**
  35. * Checks if the profile supports the specified list of commands.
  36. *
  37. * @param array $commands List of command IDs.
  38. * @return string
  39. */
  40. public function supportsCommands(Array $commands);
  41. /**
  42. * Creates a new command instance.
  43. *
  44. * @param string $method Command ID.
  45. * @param array $arguments Arguments for the command.
  46. * @return CommandInterface
  47. */
  48. public function createCommand($method, $arguments = array());
  49. }