aboutsummaryrefslogtreecommitdiffstats
path: root/util/config
diff options
context:
space:
mode:
authorWave <wave72@users.noreply.github.com>2016-07-22 10:55:02 +0200
committerGitHub <noreply@github.com>2016-07-22 10:55:02 +0200
commit744ad84714fe0f7a3d90250a4ff02dc4327b9061 (patch)
tree595fb74ec9ea0bc7130d18bd7993d719a222d343 /util/config
parentc38c79d71c8ef70ef649f83e322f1984b75ee2dd (diff)
parent7d897a3f03bd57ed556433eb84a41963ba44e02e (diff)
downloadvolse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.tar.gz
volse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.tar.bz2
volse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.zip
Merge pull request #6 from redmatrix/dev
Dev
Diffstat (limited to 'util/config')
-rwxr-xr-xutil/config45
1 files changed, 43 insertions, 2 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";
}