Added an option to configure the hostname manually. And there was a problem when APC wasn't present.

This commit is contained in:
Michael Vogel 2013-08-11 21:19:26 +02:00
parent d92a348cf0
commit e746c4955b
11 changed files with 33 additions and 3 deletions

View file

@ -24,8 +24,11 @@ function cli_startup() {
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$a->set_baseurl(get_config('system','url'));
load_hooks();
}
}

View file

@ -77,7 +77,8 @@ function get_config($family, $key, $instore = false) {
return false;
else
return $val;
} else
}
// else
//logger("APC: cache miss for value ".$family."|".$key, LOGGER_DEBUG);
@ -207,7 +208,7 @@ function get_pconfig($uid,$family, $key, $instore = false) {
return false;
else
return $val;
} else
} // else
//logger("APC: cache miss for value ".$family."|".$key, LOGGER_DEBUG);

View file

@ -24,6 +24,9 @@ function cronhooks_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$lockpath = get_config('system','lockpath');
if ($lockpath != '') {
$pidfile = new pidfile($lockpath, 'cron.lck');

View file

@ -27,6 +27,9 @@ function delivery_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
load_hooks();
if($argc < 3)

View file

@ -25,6 +25,8 @@ function expire_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$a->set_baseurl(get_config('system','url'));

View file

@ -24,6 +24,9 @@ function gprobe_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$a->set_baseurl(get_config('system','url'));
load_hooks();

View file

@ -65,6 +65,9 @@ function notifier_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
load_hooks();
if($argc < 3)

View file

@ -37,6 +37,9 @@ function onepoll_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$a->set_baseurl(get_config('system','url'));
load_hooks();

View file

@ -30,6 +30,9 @@ function poller_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$maxsysload = intval(get_config('system','maxloadavg'));
if($maxsysload < 1)
$maxsysload = 50;

View file

@ -25,6 +25,9 @@ function queue_run(&$argv, &$argc){
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
$a->set_baseurl(get_config('system','url'));
load_hooks();

View file

@ -53,6 +53,9 @@ if(!$install) {
load_config('config');
load_config('system');
if ($hostname = get_config('system', 'hostname'))
$a->set_hostname($hostname);
require_once("include/session.php");
load_hooks();
call_hooks('init_1');