shared.php 926B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. require __DIR__.'/../autoload.php';
  11. function redis_version($info)
  12. {
  13. if (isset($info['Server']['redis_version'])) {
  14. return $info['Server']['redis_version'];
  15. } elseif (isset($info['redis_version'])) {
  16. return $info['redis_version'];
  17. } else {
  18. return 'unknown version';
  19. }
  20. }
  21. $single_server = array(
  22. 'host' => '127.0.0.1',
  23. 'port' => 6379,
  24. 'database' => 15,
  25. );
  26. $multiple_servers = array(
  27. array(
  28. 'host' => '127.0.0.1',
  29. 'port' => 6379,
  30. 'database' => 15,
  31. 'alias' => 'first',
  32. ),
  33. array(
  34. 'host' => '127.0.0.1',
  35. 'port' => 6380,
  36. 'database' => 15,
  37. 'alias' => 'second',
  38. ),
  39. );