ClientInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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;
  11. use Predis\Connection\ConnectionInterface;
  12. use Predis\Option\ClientOptionsInterface;
  13. use Predis\Profile\ServerProfileInterface;
  14. /**
  15. * Interface defining the most important parts needed to create an
  16. * high-level Redis client object that can interact with other
  17. * building blocks of Predis.
  18. *
  19. * @author Daniele Alessandri <suppakilla@gmail.com>
  20. */
  21. interface ClientInterface extends BasicClientInterface
  22. {
  23. /**
  24. * Returns the server profile used by the client.
  25. *
  26. * @return ServerProfileInterface
  27. */
  28. public function getProfile();
  29. /**
  30. * Returns the client options specified upon initialization.
  31. *
  32. * @return ClientOptionsInterface
  33. */
  34. public function getOptions();
  35. /**
  36. * Opens the connection to the server.
  37. */
  38. public function connect();
  39. /**
  40. * Disconnects from the server.
  41. */
  42. public function disconnect();
  43. /**
  44. * Returns the underlying connection instance.
  45. *
  46. * @return ConnectionInterface
  47. */
  48. public function getConnection();
  49. /**
  50. * Creates a new instance of the specified Redis command.
  51. *
  52. * @param string $method The name of a Redis command.
  53. * @param array $arguments The arguments for the command.
  54. * @return CommandInterface
  55. */
  56. public function createCommand($method, $arguments = array());
  57. }