Remove util/config*

- Update Console\Config help text
This commit is contained in:
Hypolite Petovan 2018-03-18 23:36:24 -04:00
parent 2f1a1debf4
commit 3b75ea0028
3 changed files with 5 additions and 92 deletions

View File

@ -64,7 +64,11 @@ Description
Shows the value of the provided key in the category
bin/console config <category> <key> <value>
Set the value of the provided key in the category
Sets the value of the provided key in the category
Notes:
Setting config entries which are manually set in .htconfig.php may result in
conflict between database settings and the manual startup settings.
Options
-h|--help|-? Show help information

View File

@ -1,65 +0,0 @@
#!/usr/bin/env php
<?php
/**
* @brief tool to access the system config from the CLI
*
* With this script you can access the system configuration of your node from
* the CLI. You can do both, reading current values stored in the database and
* set new values to config variables.
*
* Usage:
* If you specify no parameters at the CLI, the script will list all config
* variables defined.
*
* If you specify one parameter, the scipt will list all config variables
* defined in this section of the configuration (e.g. "system").
*
* If you specify two parameters, the scipt will show you the current value
* of the named configuration setting. (e.g. "system loglevel")
*
* If you specify three parameters, the named configuration setting will be
* set to the value of the last parameter. (e.g. "system loglevel 0" will
* disable logging)
**/
use Friendica\Core\Config;
require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/text.php';
$a = get_app();
require_once '.htconfig.php';
dba::connect($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
if($argc > 3) {
Config::set($argv[1],$argv[2],$argv[3]);
echo "config[{$argv[1]}][{$argv[2]}] = " . Config::get($argv[1],$argv[2]) . "\n";
}
if($argc == 3) {
echo "config[{$argv[1]}][{$argv[2]}] = " . Config::get($argv[1],$argv[2]) . "\n";
}
if($argc == 2) {
Config::load($argv[1]);
if (!is_null($a->config[$argv[1]])) {
foreach($a->config[$argv[1]] as $k => $x) {
echo "config[{$argv[1]}][{$k}] = " . $x . "\n";
}
} else {
echo "config section '$argv[1]' returned nothing.\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";
}
}
}

View File

@ -1,26 +0,0 @@
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.