aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-14 14:25:34 -0800
committerfriendica <info@friendica.com>2013-01-14 14:25:34 -0800
commit1259a6e753f10c023accb647dd193254ff473d1a (patch)
tree46ce0709606ebacccee250507d5a525c145eb62d /util
parent3a5fea516a2b7a849d3d6969cf74dff643c88e52 (diff)
downloadvolse-hubzilla-1259a6e753f10c023accb647dd193254ff473d1a.tar.gz
volse-hubzilla-1259a6e753f10c023accb647dd193254ff473d1a.tar.bz2
volse-hubzilla-1259a6e753f10c023accb647dd193254ff473d1a.zip
command line config utility, get set system configuration values
Diffstat (limited to 'util')
-rwxr-xr-xutil/config34
1 files changed, 34 insertions, 0 deletions
diff --git a/util/config b/util/config
new file mode 100755
index 000000000..67fe14f93
--- /dev/null
+++ b/util/config
@@ -0,0 +1,34 @@
+#!/usr/bin/env php
+<?php
+
+// Red config utility
+
+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";
+}
+
+if($argc == 3) {
+ echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n";
+}
+
+if($argc == 2) {
+ load_config($argv[1]);
+ foreach($a->config[$argv[1]] as $k => $x) {
+ echo "config[{$argv[1]}][{$k}] = " . $x . "\n";
+ }
+}
+
+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";
+ }
+ }
+}
+