aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/config45
-rwxr-xr-xutil/importdoc2
-rwxr-xr-xutil/pconfig54
-rw-r--r--util/typo.php12
4 files changed, 104 insertions, 9 deletions
diff --git a/util/config b/util/config
index 9e90eca56..d4bcd5da1 100755
--- a/util/config
+++ b/util/config
@@ -3,13 +3,54 @@
// Red config utility
+if(!file_exists('include/cli_startup.php')) {
+ echo 'Run config from the top level Hubzilla web directory, as util/config <args>' . PHP_EOL;
+ exit(1);
+}
+
require_once('include/cli_startup.php');
cli_startup();
-if($argc > 3) {
-
+$helpArgs = getopt('h', array('help'));
+if (count($helpArgs) === 1) {
+ echo <<<'EndOfOutput'
+Gets, sets, or lists site-wide configuration settings.
+
+Usage: util/config
+ util/config <family>
+ util/config <family> <key>
+ util/config <family> <key> <value>
+
+ util/config
+ Displays all config entries
+
+ util/config <family>
+ Displays all config entries for family (system, database, etc)
+
+ util/config <family> <key>
+ Displays single config entry for the specified family and key
+
+ util/config <family> <key> <value>
+ Set config entry for specified family and key to value and display result
+
+Notes:
+ Setting config entries which are manually set in .htconfig.php may result
+ in conflict between database settings and the manual startup settings.
+
+ For channel-specific configuration settings, use util/pconfig
+
+ Details for configuration options can be found at:
+
+EndOfOutput;
+ echo ' ' . App::get_baseurl() . '/help/hidden_configs' . PHP_EOL . PHP_EOL;
+ return;
+}
+
+
+
+if($argc > 3) {
set_config($argv[1],$argv[2],$argv[3]);
echo "config[{$argv[1]}][{$argv[2]}] = " . printable_config(get_config($argv[1],$argv[2])) . "\n";
}
diff --git a/util/importdoc b/util/importdoc
index b89e12e97..087f472bc 100755
--- a/util/importdoc
+++ b/util/importdoc
@@ -5,7 +5,7 @@ require_once('include/cli_startup.php');
cli_startup();
-require_once('mod/help.php');
+require_once('include/help.php');
function update_docs_dir($s) {
$f = basename($s);
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;
+ }
+ }
+}
diff --git a/util/typo.php b/util/typo.php
index 0f7249f5c..e9a9be5f0 100644
--- a/util/typo.php
+++ b/util/typo.php
@@ -50,12 +50,12 @@
include_once($file);
}
- echo "Directory: mod\n";
- $files = glob('mod/*.php');
- foreach($files as $file) {
- echo $file . "\n";
- include_once($file);
- }
+// echo "Directory: mod\n";
+// $files = glob('mod/*.php');
+// foreach($files as $file) {
+// echo $file . "\n";
+// include_once($file);
+// }
echo "Directory: addon\n";
$dirs = glob('addon/*');