aboutsummaryrefslogtreecommitdiffstats
path: root/util/config
diff options
context:
space:
mode:
Diffstat (limited to 'util/config')
-rwxr-xr-xutil/config21
1 files changed, 17 insertions, 4 deletions
diff --git a/util/config b/util/config
index 67fe14f93..9e90eca56 100755
--- a/util/config
+++ b/util/config
@@ -8,17 +8,19 @@ require_once('include/cli_startup.php');
cli_startup();
if($argc > 3) {
+
+
set_config($argv[1],$argv[2],$argv[3]);
- echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n";
+ echo "config[{$argv[1]}][{$argv[2]}] = " . printable_config(get_config($argv[1],$argv[2])) . "\n";
}
if($argc == 3) {
- echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n";
+ echo "config[{$argv[1]}][{$argv[2]}] = " . printable_config(get_config($argv[1],$argv[2])) . "\n";
}
if($argc == 2) {
load_config($argv[1]);
- foreach($a->config[$argv[1]] as $k => $x) {
+ foreach(App::$config[$argv[1]] as $k => $x) {
echo "config[{$argv[1]}][{$k}] = " . $x . "\n";
}
}
@@ -27,8 +29,19 @@ if($argc == 1) {
$r = q("select * from config where 1");
if($r) {
foreach($r as $rr) {
- echo "config[{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n";
+ echo "config[{$rr['cat']}][{$rr['k']}] = " . printable_config($rr['v']) . "\n";
}
}
}
+function printable_config($x) {
+ $s = '';
+ if(is_array($x)) {
+ foreach($x as $v) {
+ $s .= $v . "\n";
+ }
+ return $s;
+ }
+ else
+ return $x;
+} \ No newline at end of file