IServerProfile.php 1.3 KB

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