load db configs (config,system) for all "executables"
This commit is contained in:
parent
3eb0b4be2a
commit
994011ddb6
7
boot.php
7
boot.php
|
@ -498,9 +498,6 @@ function install_plugin($plugin){
|
|||
if(! function_exists('check_config')) {
|
||||
function check_config(&$a) {
|
||||
|
||||
|
||||
load_config('system');
|
||||
|
||||
$build = get_config('system','build');
|
||||
if(! x($build))
|
||||
$build = set_config('system','build',DB_UPDATE_VERSION);
|
||||
|
@ -1218,9 +1215,13 @@ function load_config($family) {
|
|||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
$k = $rr['k'];
|
||||
if ($rr['cat'] === 'config') {
|
||||
$a->config[$k] = $rr['v'];
|
||||
} else {
|
||||
$a->config[$family][$k] = $rr['v'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
// get a particular config variable given the family name
|
||||
|
|
|
@ -15,6 +15,10 @@ function directory_run($argv, $argc){
|
|||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
};
|
||||
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
|
||||
if($argc != 2)
|
||||
return;
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@ function expire_run($argv, $argc){
|
|||
require_once('include/items.php');
|
||||
require_once('include/Contact.php');
|
||||
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
|
||||
$a->set_baseurl(get_config('system','url'));
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ function notifier_run($argv, $argc){
|
|||
require_once('include/items.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
load_hooks();
|
||||
|
||||
if($argc < 3)
|
||||
|
|
|
@ -24,6 +24,9 @@ function poller_run($argv, $argc){
|
|||
require_once('include/Contact.php');
|
||||
require_once('include/email.php');
|
||||
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
$a->set_baseurl(get_config('system','url'));
|
||||
|
||||
load_hooks();
|
||||
|
|
|
@ -22,6 +22,9 @@ function queue_run($argv, $argc){
|
|||
require_once('include/items.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
$a->set_baseurl(get_config('system','url'));
|
||||
|
||||
load_hooks();
|
||||
|
|
11
index.php
11
index.php
|
@ -50,15 +50,8 @@ if(! $install) {
|
|||
* Load configs from db. Overwrite configs from .htconfig.php
|
||||
*/
|
||||
|
||||
$r = q("SELECT * FROM `config` WHERE `cat` IN ('system', 'config')");
|
||||
foreach ($r as $c) {
|
||||
if ($c['cat']=='config') {
|
||||
$a->config[$c['k']] = $c['v'];
|
||||
} else {
|
||||
$a->config[$c['cat']][$c['k']] = $c['v'];
|
||||
}
|
||||
}
|
||||
unset($r);
|
||||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
require_once("session.php");
|
||||
load_hooks();
|
||||
|
|
Loading…
Reference in a new issue