Replaced $argv and $argc with the $_SERVER array
This commit is contained in:
parent
b5beb4c69a
commit
cce561708a
15 changed files with 47 additions and 57 deletions
|
@ -66,6 +66,6 @@ function cronhooks_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
cronhooks_run($argv,$argc);
|
||||
cronhooks_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -1339,6 +1339,6 @@ function dbstructure_run(&$argv, &$argc) {
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
dbstructure_run($argv,$argc);
|
||||
dbstructure_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -23,6 +23,6 @@ function dbupdate_run(&$argv, &$argc) {
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
dbupdate_run($argv,$argc);
|
||||
dbupdate_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -565,6 +565,6 @@ function delivery_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
delivery_run($argv,$argc);
|
||||
delivery_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,6 @@ function directory_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
directory_run($argv,$argc);
|
||||
directory_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,6 @@ function dsprphotoq_run($argv, $argc){
|
|||
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
dsprphotoq_run($argv,$argc);
|
||||
dsprphotoq_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,6 @@ function expire_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
expire_run($argv,$argc);
|
||||
expire_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,6 @@ function gprobe_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
gprobe_run($argv,$argc);
|
||||
gprobe_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -5,16 +5,16 @@ require_once('include/html2plain.php');
|
|||
|
||||
/*
|
||||
* This file was at one time responsible for doing all deliveries, but this caused
|
||||
* big problems on shared hosting systems, where the process might get killed by the
|
||||
* hosting provider and nothing would get delivered.
|
||||
* big problems on shared hosting systems, where the process might get killed by the
|
||||
* hosting provider and nothing would get delivered.
|
||||
* It now only delivers one message under certain cases, and invokes a queued
|
||||
* delivery mechanism (include/deliver.php) to deliver individual contacts at
|
||||
* delivery mechanism (include/deliver.php) to deliver individual contacts at
|
||||
* controlled intervals.
|
||||
* This has a much better chance of surviving random processes getting killed
|
||||
* by the hosting provider.
|
||||
* by the hosting provider.
|
||||
* A lot of this code is duplicated in include/deliver.php until we have time to go back
|
||||
* and re-structure the delivery procedure based on the obstacles that have been thrown at
|
||||
* us by hosting providers.
|
||||
* and re-structure the delivery procedure based on the obstacles that have been thrown at
|
||||
* us by hosting providers.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -50,7 +50,7 @@ function notifier_run(&$argv, &$argc){
|
|||
if(is_null($a)){
|
||||
$a = new App;
|
||||
}
|
||||
|
||||
|
||||
if(is_null($db)) {
|
||||
@include(".htconfig.php");
|
||||
require_once("include/dba.php");
|
||||
|
@ -946,7 +946,7 @@ function notifier_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if((! $mail) && (! $fsuggest) && (! $followup)) {
|
||||
logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
|
||||
logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
|
||||
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
|
||||
if($interval)
|
||||
@time_sleep_until(microtime(true) + (float) $interval);
|
||||
|
@ -966,7 +966,7 @@ function notifier_run(&$argv, &$argc){
|
|||
if ($h === '[internal]') {
|
||||
// Set push flag for PuSH subscribers to this topic,
|
||||
// they will be notified in queue.php
|
||||
q("UPDATE `push_subscriber` SET `push` = 1 " .
|
||||
q("UPDATE `push_subscriber` SET `push` = 1 " .
|
||||
"WHERE `nickname` = '%s'", dbesc($owner['nickname']));
|
||||
} else {
|
||||
|
||||
|
@ -1001,6 +1001,6 @@ function notifier_run(&$argv, &$argc){
|
|||
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
notifier_run($argv,$argc);
|
||||
notifier_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -586,8 +586,8 @@ function onepoll_run(&$argv, &$argc){
|
|||
|
||||
// load current friends if possible.
|
||||
|
||||
if($contact['poco']) {
|
||||
$r = q("SELECT count(*) as total from glink
|
||||
if($contact['poco']) {
|
||||
$r = q("SELECT count(*) as total from glink
|
||||
where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
|
||||
intval($contact['id'])
|
||||
);
|
||||
|
@ -602,6 +602,6 @@ function onepoll_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
onepoll_run($argv,$argc);
|
||||
onepoll_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -301,6 +301,6 @@ function poller_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
poller_run($argv,$argc);
|
||||
poller_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -265,6 +265,6 @@ function queue_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0){
|
||||
queue_run($argv,$argc);
|
||||
queue_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
killme();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue