aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-14 20:47:04 -0700
committerfriendica <info@friendica.com>2013-08-14 20:47:04 -0700
commit258d8e3189505f177e68e967322c70c1344291f9 (patch)
treeeb4439526216261c34ce7fc6e6afdb4c1ff458ac
parentac541a7d3246e1c5c60ae752326c1b9ba5ccd78f (diff)
downloadvolse-hubzilla-258d8e3189505f177e68e967322c70c1344291f9.tar.gz
volse-hubzilla-258d8e3189505f177e68e967322c70c1344291f9.tar.bz2
volse-hubzilla-258d8e3189505f177e68e967322c70c1344291f9.zip
util/pconfig - if you understand util/config you'll understand this; if you don't you won't
-rwxr-xr-xutil/pconfig34
1 files changed, 34 insertions, 0 deletions
diff --git a/util/pconfig b/util/pconfig
new file mode 100755
index 000000000..baa786a03
--- /dev/null
+++ b/util/pconfig
@@ -0,0 +1,34 @@
+#!/usr/bin/env php
+<?php
+
+// Red pconfig utility
+
+require_once('include/cli_startup.php');
+
+cli_startup();
+
+if($argc > 4) {
+ set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
+ echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
+}
+
+if($argc == 4) {
+ echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
+}
+
+if($argc == 3) {
+ load_pconfig($argv[1],$argv[2]);
+ foreach($a->config[$argv[1]][$argv[2]] as $k => $x) {
+ echo "pconfig[{$argv[1]}][{$argv[2]}][{$k}] = " . $x . "\n";
+ }
+}
+
+if($argc == 2) {
+ $r = q("select * from pconfig where uid = " . intval($argv[1]));
+ if($r) {
+ foreach($r as $rr) {
+ echo "pconfig[{$rr['uid']}][{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n";
+ }
+ }
+}
+