OptionsInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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\Configuration;
  11. /**
  12. * Defines an options container class.
  13. *
  14. * @property-read mixed aggregate Custom connection aggregator.
  15. * @property-read mixed cluster Aggregate connection for clustering.
  16. * @property-read mixed connections Connection factory.
  17. * @property-read mixed exceptions Toggles exceptions in client for -ERR responses.
  18. * @property-read mixed prefix Key prefixing strategy using the given prefix.
  19. * @property-read mixed profile Server profile.
  20. * @property-read mixed replication Aggregate connection for replication.
  21. *
  22. * @author Daniele Alessandri <suppakilla@gmail.com>
  23. */
  24. interface OptionsInterface
  25. {
  26. /**
  27. * Returns the default value for the given option.
  28. *
  29. * @param string $option Name of the option.
  30. * @return mixed
  31. */
  32. public function getDefault($option);
  33. /**
  34. * Checks if the given option has been set by the user upon initialization.
  35. *
  36. * @param string $option Name of the option.
  37. * @return bool
  38. */
  39. public function defined($option);
  40. /**
  41. * Checks if the given option has been set and does not evaluate to NULL.
  42. *
  43. * @param string $option Name of the option.
  44. * @return bool
  45. */
  46. public function __isset($option);
  47. /**
  48. * Returns the value of the given option.
  49. *
  50. * @param string $option Name of the option.
  51. * @return mixed
  52. */
  53. public function __get($option);
  54. }