File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "require" : {
3- "ext-amqp" : " *" ,
4- "cloudfoundry-community/cf-helper-php" : " 1.6.*"
3+ "ext-amqp" : " *"
54 }
65}
Original file line number Diff line number Diff line change 11{
22 "require" : {
33 "ext-redis" : " *" ,
4- "ext-igbinary" : " *" ,
5- "cloudfoundry-community/cf-helper-php" : " 1.6.*"
4+ "ext-igbinary" : " *"
65 }
76}
Original file line number Diff line number Diff line change 55<body>
66<h1>This page initiates a Redis connection and displays Redis info via the phpredis client.</h1>
77<?php
8- require_once 'vendor/autoload.php ' ;
9- use CfCommunity \CfHelper \CfHelper ;
10- $ cfHelper = CfHelper::getInstance ();
11-
12- # Try to fetch Redis VCAP_SERVICES values
13- $ serviceManager = $ cfHelper ->getServiceManager ();
14- $ redisService = $ serviceManager ->getService ('.*redis.* ' );
15-
16- $ defaultUrl = "localhost " ;
17- $ defaulPort = 6379 ;
18- $ defaulPassword = "password " ;
19-
20- # Prevent PHP Errors if no service is bound
21- if (is_null ($ redisService )){
22- $ redisUrl = $ defaultUrl ;
23- $ redisPort = $ defaulPort ;
24- $ redisPassword = $ defaulPassword ;
25- }
26- else {
27- $ redisUrl = $ redisService ->getValue ('hostname ' );
28- $ redisPort = $ redisService ->getValue ('port ' );
29- $ redisPassword = $ redisService ->getValue ('password ' );
30- }
8+ $ redisUrl = "localhost " ;
9+ $ redisPort = 6379 ;
10+ $ redisPassword = "password " ;
3111
3212 print "<p>RedisUrl: $ redisUrl</p> " ;
3313 print "<p>RedisPort: $ redisPort</p> " ;
34- print "<p>RedisUrl : redacted</p> " ;
14+ print "<p>RedisPassword : redacted</p> " ;
3515
3616 # Establish Redis connection and authenticate
3717 $ redis = new Redis ();
You can’t perform that action at this time.
0 commit comments