From 1caa87dce654c25e24749211e746cf55a20dee9c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 9 Sep 2016 20:55:49 +0000 Subject: [PATCH] Restructured the way, processes are inserted and removed --- boot.php | 2 -- include/auth_ejabberd.php | 2 -- include/cli_startup.php | 2 -- include/cron.php | 2 -- include/cronhooks.php | 2 -- include/cronjobs.php | 2 -- include/dbstructure.php | 2 -- include/dbupdate.php | 2 -- include/delivery.php | 2 -- include/directory.php | 2 -- include/discover_poco.php | 2 -- include/expire.php | 2 -- include/gprobe.php | 2 -- include/notifier.php | 2 -- include/onepoll.php | 2 -- include/poller.php | 7 +++++-- include/pubsubpublish.php | 2 -- include/queue.php | 2 -- include/shadowupdate.php | 2 -- include/tagupdate.php | 2 -- include/threadupdate.php | 2 -- include/update_gcontact.php | 2 -- 22 files changed, 5 insertions(+), 44 deletions(-) diff --git a/boot.php b/boot.php index 7097f3f983..87ce53076c 100644 --- a/boot.php +++ b/boot.php @@ -1736,8 +1736,6 @@ function login($register = false, $hiddens=false) { */ function killme() { - get_app()->end_process(); - if (!get_app()->is_backend()) session_write_close(); diff --git a/include/auth_ejabberd.php b/include/auth_ejabberd.php index d7e91a5b2c..9a9d9accad 100755 --- a/include/auth_ejabberd.php +++ b/include/auth_ejabberd.php @@ -58,8 +58,6 @@ if(is_null($db)) { 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 $sLogFile = get_config('jabber','logfile'); diff --git a/include/cli_startup.php b/include/cli_startup.php index 7b15fbfb30..4cb86adef8 100644 --- a/include/cli_startup.php +++ b/include/cli_startup.php @@ -19,8 +19,6 @@ function cli_startup() { unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); load_config('config'); diff --git a/include/cron.php b/include/cron.php index dde458a4a6..0669f24a1e 100644 --- a/include/cron.php +++ b/include/cron.php @@ -27,8 +27,6 @@ function cron_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); require_once('include/items.php'); diff --git a/include/cronhooks.php b/include/cronhooks.php index 986a86dfbb..4bb1e5f659 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -17,8 +17,6 @@ function cronhooks_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); diff --git a/include/cronjobs.php b/include/cronjobs.php index 6df2dcd035..1511efbe0d 100644 --- a/include/cronjobs.php +++ b/include/cronjobs.php @@ -27,8 +27,6 @@ function cronjobs_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); require_once('include/ostatus.php'); diff --git a/include/dbstructure.php b/include/dbstructure.php index 4530a78599..e7514872fd 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -1467,8 +1467,6 @@ function dbstructure_run(&$argv, &$argc) { unset($db_host, $db_user, $db_pass, $db_data); } - $a->start_process(); - if ($argc==2) { switch ($argv[1]) { case "update": diff --git a/include/dbupdate.php b/include/dbupdate.php index 898f459630..28f1de340b 100644 --- a/include/dbupdate.php +++ b/include/dbupdate.php @@ -16,8 +16,6 @@ function dbupdate_run(&$argv, &$argc) { unset($db_host, $db_user, $db_pass, $db_data); } - $a->start_process(); - load_config('config'); load_config('system'); diff --git a/include/delivery.php b/include/delivery.php index 59cab43714..fe33774382 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -21,8 +21,6 @@ function delivery_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); } - $a->start_process(); - require_once("include/session.php"); require_once("include/datetime.php"); require_once('include/items.php'); diff --git a/include/directory.php b/include/directory.php index 381020c8a5..85476bd5fd 100644 --- a/include/directory.php +++ b/include/directory.php @@ -15,8 +15,6 @@ function directory_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - load_config('config'); load_config('system'); diff --git a/include/discover_poco.php b/include/discover_poco.php index 9c9be8209c..0b468faea1 100644 --- a/include/discover_poco.php +++ b/include/discover_poco.php @@ -18,8 +18,6 @@ function discover_poco_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); diff --git a/include/expire.php b/include/expire.php index cfd38d3dcd..873c594e84 100644 --- a/include/expire.php +++ b/include/expire.php @@ -16,8 +16,6 @@ function expire_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); require_once('include/items.php'); diff --git a/include/gprobe.php b/include/gprobe.php index d3ab028f1e..91b9b16e33 100644 --- a/include/gprobe.php +++ b/include/gprobe.php @@ -18,8 +18,6 @@ function gprobe_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); diff --git a/include/notifier.php b/include/notifier.php index 5f700ee716..0610a4e398 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -54,8 +54,6 @@ function notifier_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); } - $a->start_process(); - require_once("include/session.php"); require_once("include/datetime.php"); require_once('include/items.php'); diff --git a/include/onepoll.php b/include/onepoll.php index c89e5b257c..e779372720 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -24,8 +24,6 @@ function onepoll_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/session.php'); require_once('include/datetime.php'); require_once('include/items.php'); diff --git a/include/poller.php b/include/poller.php index 83ecb29395..ce2a6be0fa 100644 --- a/include/poller.php +++ b/include/poller.php @@ -333,7 +333,10 @@ function poller_active_workers() { } if (array_search(__file__,get_included_files())===0){ - poller_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); + poller_run($_SERVER["argv"],$_SERVER["argc"]); + + get_app()->end_process(); + + killme(); } ?> diff --git a/include/pubsubpublish.php b/include/pubsubpublish.php index 3fff746cb2..85637facb2 100644 --- a/include/pubsubpublish.php +++ b/include/pubsubpublish.php @@ -70,8 +70,6 @@ function pubsubpublish_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/items.php'); load_config('config'); diff --git a/include/queue.php b/include/queue.php index 6dcdfc8960..ad7079e959 100644 --- a/include/queue.php +++ b/include/queue.php @@ -17,8 +17,6 @@ function queue_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once("include/session.php"); require_once("include/datetime.php"); require_once('include/items.php'); diff --git a/include/shadowupdate.php b/include/shadowupdate.php index e003edea17..74c2a43ebd 100644 --- a/include/shadowupdate.php +++ b/include/shadowupdate.php @@ -14,8 +14,6 @@ if(is_null($db)) { unset($db_host, $db_user, $db_pass, $db_data); } -$a->start_process(); - load_config('config'); load_config('system'); diff --git a/include/tagupdate.php b/include/tagupdate.php index f962a8f3ac..b12e809772 100644 --- a/include/tagupdate.php +++ b/include/tagupdate.php @@ -14,8 +14,6 @@ if(is_null($db)) { unset($db_host, $db_user, $db_pass, $db_data); } -$a->start_process(); - load_config('config'); load_config('system'); diff --git a/include/threadupdate.php b/include/threadupdate.php index 454a4680af..e9d9bf6e6b 100644 --- a/include/threadupdate.php +++ b/include/threadupdate.php @@ -14,8 +14,6 @@ if(is_null($db)) { unset($db_host, $db_user, $db_pass, $db_data); } -$a->start_process(); - load_config('config'); load_config('system'); diff --git a/include/update_gcontact.php b/include/update_gcontact.php index ba0993d14d..88e1817f0b 100644 --- a/include/update_gcontact.php +++ b/include/update_gcontact.php @@ -16,8 +16,6 @@ function update_gcontact_run(&$argv, &$argc){ unset($db_host, $db_user, $db_pass, $db_data); }; - $a->start_process(); - require_once('include/Scrape.php'); require_once("include/socgraph.php");