Restructured the way, processes are inserted and removed

This commit is contained in:
Michael Vogel 2016-09-09 20:55:49 +00:00
parent 22f32d9721
commit 1caa87dce6
22 changed files with 5 additions and 44 deletions

View file

@ -1736,8 +1736,6 @@ function login($register = false, $hiddens=false) {
*/ */
function killme() { function killme() {
get_app()->end_process();
if (!get_app()->is_backend()) if (!get_app()->is_backend())
session_write_close(); session_write_close();

View file

@ -58,8 +58,6 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
// the logfile to which to write, should be writeable by the user which is running the server // the logfile to which to write, should be writeable by the user which is running the server
$sLogFile = get_config('jabber','logfile'); $sLogFile = get_config('jabber','logfile');

View file

@ -19,8 +19,6 @@ function cli_startup() {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
load_config('config'); load_config('config');

View file

@ -27,8 +27,6 @@ function cron_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
require_once('include/items.php'); require_once('include/items.php');

View file

@ -17,8 +17,6 @@ function cronhooks_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');

View file

@ -27,8 +27,6 @@ function cronjobs_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
require_once('include/ostatus.php'); require_once('include/ostatus.php');

View file

@ -1467,8 +1467,6 @@ function dbstructure_run(&$argv, &$argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
if ($argc==2) { if ($argc==2) {
switch ($argv[1]) { switch ($argv[1]) {
case "update": case "update":

View file

@ -16,8 +16,6 @@ function dbupdate_run(&$argv, &$argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
load_config('config'); load_config('config');
load_config('system'); load_config('system');

View file

@ -21,8 +21,6 @@ function delivery_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
require_once("include/session.php"); require_once("include/session.php");
require_once("include/datetime.php"); require_once("include/datetime.php");
require_once('include/items.php'); require_once('include/items.php');

View file

@ -15,8 +15,6 @@ function directory_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
load_config('config'); load_config('config');
load_config('system'); load_config('system');

View file

@ -18,8 +18,6 @@ function discover_poco_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');

View file

@ -16,8 +16,6 @@ function expire_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
require_once('include/items.php'); require_once('include/items.php');

View file

@ -18,8 +18,6 @@ function gprobe_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');

View file

@ -54,8 +54,6 @@ function notifier_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
require_once("include/session.php"); require_once("include/session.php");
require_once("include/datetime.php"); require_once("include/datetime.php");
require_once('include/items.php'); require_once('include/items.php');

View file

@ -24,8 +24,6 @@ function onepoll_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
require_once('include/items.php'); require_once('include/items.php');

View file

@ -333,7 +333,10 @@ function poller_active_workers() {
} }
if (array_search(__file__,get_included_files())===0){ if (array_search(__file__,get_included_files())===0){
poller_run($_SERVER["argv"],$_SERVER["argc"]); poller_run($_SERVER["argv"],$_SERVER["argc"]);
killme();
get_app()->end_process();
killme();
} }
?> ?>

View file

@ -70,8 +70,6 @@ function pubsubpublish_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/items.php'); require_once('include/items.php');
load_config('config'); load_config('config');

View file

@ -17,8 +17,6 @@ function queue_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once("include/session.php"); require_once("include/session.php");
require_once("include/datetime.php"); require_once("include/datetime.php");
require_once('include/items.php'); require_once('include/items.php');

View file

@ -14,8 +14,6 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
load_config('config'); load_config('config');
load_config('system'); load_config('system');

View file

@ -14,8 +14,6 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
load_config('config'); load_config('config');
load_config('system'); load_config('system');

View file

@ -14,8 +14,6 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
$a->start_process();
load_config('config'); load_config('config');
load_config('system'); load_config('system');

View file

@ -16,8 +16,6 @@ function update_gcontact_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$a->start_process();
require_once('include/Scrape.php'); require_once('include/Scrape.php');
require_once("include/socgraph.php"); require_once("include/socgraph.php");