ClientInterface.php 1.6 KB

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