Browse Source

config cli will also work with Friendica without change - so bringing it over

pull/585/merge
friendica 9 years ago
parent
commit
66a6970bb8
  1. 2
      boot.php
  2. 34
      util/config
  3. 26
      util/config.md
  4. 366
      util/messages.po

2
boot.php

@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1586' );
define ( 'FRIENDICA_VERSION', '3.1.1588' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1158 );

34
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";
}
}
}

26
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.

366
util/messages.po
File diff suppressed because it is too large
View File

Loading…
Cancel
Save