diff options
-rw-r--r-- | boot.php | 2 | ||||
-rwxr-xr-x | util/config | 34 | ||||
-rw-r--r-- | util/config.md | 26 |
3 files changed, 61 insertions, 1 deletions
@@ -1268,7 +1268,7 @@ function profile_load(&$a, $nickname, $profile = 0) { $r = null; -//TODO needs avatar_date !! + if($profile) { $profile_int = intval($profile); diff --git a/util/config b/util/config new file mode 100755 index 000000000..67fe14f93 --- /dev/null +++ b/util/config @@ -0,0 +1,34 @@ +#!/usr/bin/env php +<?php + +// Red config utility + +require_once('include/cli_startup.php'); + +cli_startup(); + +if($argc > 3) { + set_config($argv[1],$argv[2],$argv[3]); + echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n"; +} + +if($argc == 3) { + echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n"; +} + +if($argc == 2) { + load_config($argv[1]); + foreach($a->config[$argv[1]] as $k => $x) { + echo "config[{$argv[1]}][{$k}] = " . $x . "\n"; + } +} + +if($argc == 1) { + $r = q("select * from config where 1"); + if($r) { + foreach($r as $rr) { + echo "config[{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n"; + } + } +} + diff --git a/util/config.md b/util/config.md new file mode 100644 index 000000000..3b834fe01 --- /dev/null +++ b/util/config.md @@ -0,0 +1,26 @@ +CLI config utility +================== + +Usage: + + +config + displays all config entries + + +config family + displays all config entries for family (system, database, etc) + + +config family key + displays single config entry for specified family and key + +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. + |