ClientInterface.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 or, when connected to a cluster,
  45. * one of the connection instances identified by its alias.
  46. *
  47. * @param string $id The alias of a connection when connected to a cluster.
  48. * @return ConnectionInterface
  49. */
  50. public function getConnection($id = null);
  51. /**
  52. * Creates a new instance of the specified Redis command.
  53. *
  54. * @param string $method The name of a Redis command.
  55. * @param array $arguments The arguments for the command.
  56. * @return CommandInterface
  57. */
  58. public function createCommand($method, $arguments = array());
  59. }