aboutsummaryrefslogtreecommitdiffstats
path: root/util/pconfig
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2014-06-24 19:34:36 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2014-06-24 19:34:36 +0200
commitb8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70 (patch)
tree718df6305bcb82c8dcb4b287a7132422e748cdfb /util/pconfig
parentc2d520f1be115fb3cb5da2a35eb10146cecee8aa (diff)
parenta92fb0b04c3e6474ec48faf8e4cc65c382e89d66 (diff)
downloadvolse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.gz
volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.bz2
volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'util/pconfig')
-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";
+ }
+ }
+}
+