5 * @brief tool to access the system config from the CLI
7 * With this script you can access the system configuration of your node from
8 * the CLI. You can do both, reading current values stored in the database and
9 * set new values to config variables.
12 * If you specify no parameters at the CLI, the script will list all config
15 * If you specify one parameter, the scipt will list all config variables
16 * defined in this section of the configuration (e.g. "system").
18 * If you specify two parameters, the scipt will show you the current value
19 * of the named configuration setting. (e.g. "system loglevel")
21 * If you specify three parameters, the named configuration setting will be
22 * set to the value of the last parameter. (e.g. "system loglevel 0" will
26 use Friendica\Core\Config;
28 require_once 'boot.php';
29 require_once 'include/dba.php';
30 require_once 'include/text.php';
32 require_once '.htconfig.php';
34 dba::connect($db_host, $db_user, $db_pass, $db_data);
35 unset($db_host, $db_user, $db_pass, $db_data);
38 Config::set($argv[1],$argv[2],$argv[3]);
39 echo "config[{$argv[1]}][{$argv[2]}] = " . Config::get($argv[1],$argv[2]) . "\n";
43 echo "config[{$argv[1]}][{$argv[2]}] = " . Config::get($argv[1],$argv[2]) . "\n";
47 Config::load($argv[1]);
48 if (!is_null($a->config[$argv[1]])) {
49 foreach($a->config[$argv[1]] as $k => $x) {
50 echo "config[{$argv[1]}][{$k}] = " . $x . "\n";
53 echo "config section '$argv[1]' returned nothing.\n";
58 $r = q("select * from config where 1");
61 echo "config[{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n";