From 994011ddb6cc1097214537160a10bf710aedc553 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 30 Jun 2011 01:15:18 -0700 Subject: load db configs (config,system) for all "executables" --- include/directory.php | 24 ++++++++++++++---------- include/expire.php | 4 ++++ include/notifier.php | 3 +++ include/poller.php | 3 +++ include/queue.php | 3 +++ 5 files changed, 27 insertions(+), 10 deletions(-) (limited to 'include') 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(); -- cgit v1.2.3