ProfileInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 profile defines all the features and commands supported by certain versions
  14. * of Redis. Instances of Predis\Client should use a server profile matching the
  15. * version of Redis being used.
  16. *
  17. * @author Daniele Alessandri <suppakilla@gmail.com>
  18. */
  19. interface ProfileInterface
  20. {
  21. /**
  22. * Returns the profile version corresponding to the 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 $commandID Command ID.
  31. *
  32. * @return bool
  33. */
  34. public function supportsCommand($commandID);
  35. /**
  36. * Checks if the profile supports the specified list of commands.
  37. *
  38. * @param array $commandIDs List of command IDs.
  39. *
  40. * @return string
  41. */
  42. public function supportsCommands(array $commandIDs);
  43. /**
  44. * Creates a new command instance.
  45. *
  46. * @param string $commandID Command ID.
  47. * @param array $arguments Arguments for the command.
  48. *
  49. * @return CommandInterface
  50. */
  51. public function createCommand($commandID, array $arguments = array());
  52. }