aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-30 01:15:18 -0700
committerFriendika <info@friendika.com>2011-06-30 01:15:18 -0700
commit994011ddb6cc1097214537160a10bf710aedc553 (patch)
treee4f88c8e8db8f78c1c5c3362919aa3ca32eb3b20
parent3eb0b4be2a7e0f4d8f9a518114e1daa49f46b59b (diff)
downloadvolse-hubzilla-994011ddb6cc1097214537160a10bf710aedc553.tar.gz
volse-hubzilla-994011ddb6cc1097214537160a10bf710aedc553.tar.bz2
volse-hubzilla-994011ddb6cc1097214537160a10bf710aedc553.zip
load db configs (config,system) for all "executables"
-rw-r--r--boot.php9
-rw-r--r--include/directory.php24
-rw-r--r--include/expire.php4
-rw-r--r--include/notifier.php3
-rw-r--r--include/poller.php3
-rw-r--r--include/queue.php3
-rw-r--r--index.php11
7 files changed, 34 insertions, 23 deletions
diff --git a/boot.php b/boot.php
index f66cf4bc0..ff036c3df 100644
--- a/boot.php
+++ b/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,7 +1215,11 @@ function load_config($family) {
if(count($r)) {
foreach($r as $rr) {
$k = $rr['k'];
- $a->config[$family][$k] = $rr['v'];
+ if ($rr['cat'] === 'config') {
+ $a->config[$k] = $rr['v'];
+ } else {
+ $a->config[$family][$k] = $rr['v'];
+ }
}
}
}}
diff --git a/include/directory.php b/include/directory.php
index 2c9daa5ea..cae78adb4 100644
--- a/include/directory.php
+++ b/include/directory.php
@@ -2,18 +2,22 @@
require_once("boot.php");
function directory_run($argv, $argc){
- global $a, $db;
+ global $a, $db;
- if(is_null($a)){
- $a = new App;
- }
+ if(is_null($a)) {
+ $a = new App;
+ }
- if(is_null($db)){
- @include(".htconfig.php");
- require_once("dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
- };
+ if(is_null($db)) {
+ @include(".htconfig.php");
+ require_once("dba.php");
+ $db = new dba($db_host, $db_user, $db_pass, $db_data);
+ unset($db_host, $db_user, $db_pass, $db_data);
+ };
+
+ load_config('config');
+ load_config('system');
+
if($argc != 2)
return;
diff --git a/include/expire.php b/include/expire.php
index cf3b7c8e2..64dbe2536 100644
--- a/include/expire.php
+++ b/include/expire.php
@@ -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'));
diff --git a/include/notifier.php b/include/notifier.php
index d9f903853..4b97311f6 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -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)
diff --git a/include/poller.php b/include/poller.php
index 99517a7ee..4cab5a3b8 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -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();
diff --git a/include/queue.php b/include/queue.php
index cbda196da..fb65d5c25 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -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();
diff --git a/index.php b/index.php
index a58e4730f..2e24c5b01 100644
--- a/index.php
+++ b/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();