aboutsummaryrefslogtreecommitdiffstats
path: root/util/pconfig
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-04-27 05:56:19 -0400
committerAndrew Manning <tamanning@zoho.com>2016-04-27 05:56:19 -0400
commitf975d9dfe457cb6912e7e0907406a86556537524 (patch)
tree10c02ebfbd5f2acf1f2944b0f28f7c97c4b8454a /util/pconfig
parentf027bf81cdaddee5d6474199c1b7adce50e6e07d (diff)
parenta6baa5a6da5f5231c119cab3170f68cf271f703b (diff)
downloadvolse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.tar.gz
volse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.tar.bz2
volse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into help-content
Diffstat (limited to 'util/pconfig')
-rwxr-xr-xutil/pconfig54
1 files changed, 54 insertions, 0 deletions
diff --git a/util/pconfig b/util/pconfig
index 038fa74c3..1afba8306 100755
--- a/util/pconfig
+++ b/util/pconfig
@@ -3,11 +3,57 @@
// Red pconfig utility
+
+if(!file_exists('include/cli_startup.php')) {
+ echo 'Run pconfig from the top level Hubzilla web directory, as util/pconfig <args>' . PHP_EOL;
+ exit(1);
+}
+
+
+
require_once('include/cli_startup.php');
require_once('include/zot.php');
cli_startup();
+$helpArgs = getopt('h', array('help'));
+if (count($helpArgs) === 1) {
+ echo <<<'EndOfOutput'
+Gets, sets, or lists personal (per channel) configuration settings.
+
+Usage: util/pconfig
+ util/pconfig <channel_id>
+ util/pconfig <channel_id> <family>
+ util/pconfig <channel_id> <family> <key>
+ util/pconfig <channel_id> <family> <key> <value>
+
+ util/pconfig
+ List all channel IDs
+
+ util/pconfig <channel_id>
+ Displays all of the the channel's config entries
+
+ util/pconfig <channel_id> <family>
+ Displays all of the channel's config entries for the specified family
+ (system, database, etc)
+
+ util/pconfig <channel_id> <family> <key>
+ Displays single config entry for the specified family and key
+
+ util/pconfig <channel_id> <family> <key> <value>
+ Set config entry for specified family and key to value and display result
+
+Notes:
+ For site-wide configuration settings, use util/config
+
+ Details for configuration options can be found at:
+
+EndOfOutput;
+ echo ' ' . App::get_baseurl() . '/help/hidden_configs' . PHP_EOL . PHP_EOL;
+ return;
+}
+
+
if($argc > 4) {
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
build_sync_packet($argv[1]);
@@ -34,3 +80,11 @@ if($argc == 2) {
}
}
+if($argc == 1) {
+ $r = q("select channel_id, channel_name from channel");
+ if($r) {
+ foreach($r as $rr) {
+ echo sprintf('%4u %s', $rr['channel_id'], $rr['channel_name']) . PHP_EOL;
+ }
+ }
+}