]> git.mxchange.org Git - friendica.git/commitdiff
load db configs (config,system) for all "executables"
authorFriendika <info@friendika.com>
Thu, 30 Jun 2011 08:15:18 +0000 (01:15 -0700)
committerFriendika <info@friendika.com>
Thu, 30 Jun 2011 08:15:18 +0000 (01:15 -0700)
boot.php
include/directory.php
include/expire.php
include/notifier.php
include/poller.php
include/queue.php
index.php

index f66cf4bc0fe39e98f98af7a251fa2506d1c93bb8..ff036c3dfa603bc79a390bd94a06c51580ca5c61 100644 (file)
--- 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'];
+                       }
                }
        }
 }}
index 2c9daa5ea6f3b025241a0a2d65f79bc734c417c1..cae78adb4e61564c161f390ed5959fe04c6f112c 100644 (file)
@@ -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;
index cf3b7c8e2da981ea8193d9c79cc975d94241a10f..64dbe2536d4d880294f8060bd6e1b684d1af83df 100644 (file)
@@ -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'));
 
 
index d9f9038533c9b1638e4a31d6edcaec886ff71a6b..4b97311f65df8d3a38ccceb491e9b4a5d9b0f48c 100644 (file)
@@ -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)
index 99517a7ee823060a2aba03dd33d2c332a8ee5d73..4cab5a3b83fb1238616ed26567af966a5b95b33d 100644 (file)
@@ -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();
index cbda196dac303505ab7399d31e162c38845b4f05..fb65d5c25bcbaf88e91815a98c2f9a11259a0473 100644 (file)
@@ -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();
index a58e4730fa42fe77744b18c548af26f7b5f141a3..2e24c5b015c3130fafba4d9df2ea5a51e449bc13 100644 (file)
--- 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();