Skip to content

Commit 8459eb1

Browse files
Merge pull request erikdubbelboer#36 from toubsen/master
Added per server configuration for seperator
2 parents d61095a + 2b27725 commit 8459eb1

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

includes/common.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
$server['filter'] = '*';
7979
}
8080

81+
if (!isset($server['seperator'])) {
82+
$server['seperator'] = $config['seperator'];
83+
}
84+
8185
// Setup a connection to Redis.
8286
$redis = new Predis\Client('tcp://'.$server['host'].':'.$server['port']);
8387

includes/config.sample.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'name' => 'local server', // Optional name.
88
'host' => '127.0.0.1',
99
'port' => 6379,
10-
'filter' => '*'
10+
'filter' => '*',
1111

1212
// Optional Redis authentication.
1313
//'auth' => 'redispasswordhere' // Warning: The password is sent in plain-text to the Redis server.
@@ -24,6 +24,7 @@
2424
'port' => 6379,
2525
'db' => 1 // Optional database number, see http://redis.io/commands/select
2626
'filter' => 'something:*' // Show only parts of database for speed or security reasons
27+
'seperator' => '/', // Use a different seperator on this database
2728
)*/
2829
),
2930

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
continue;
2222
}
2323

24-
$key = explode($config['seperator'], $key);
24+
$key = explode($server['seperator'], $key);
2525

2626
// $d will be a reference to the current namespace.
2727
$d = &$namespaces;
@@ -132,7 +132,7 @@ function print_namespace($item, $name, $fullkey, $islast) {
132132
if ($fullkey === '') {
133133
$childfullkey = $childname;
134134
} else {
135-
$childfullkey = $fullkey.$config['seperator'].$childname;
135+
$childfullkey = $fullkey.$server['seperator'].$childname;
136136
}
137137

138138
print_namespace($childitem, $childname, $childfullkey, (--$l == 0));

0 commit comments

Comments
 (0)