aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-01-24 22:01:56 +0100
committerfabrixxm <fabrix.xm@gmail.com>2011-01-24 22:01:56 +0100
commit2020ea23b106c159a705c26e6c79156aafde75ba (patch)
tree32d813d034fe626a7d85279cb20c2497857e5b0e
parente9251499dd63523a552bc3bf6274e3b851cba4c8 (diff)
downloadvolse-hubzilla-2020ea23b106c159a705c26e6c79156aafde75ba.tar.gz
volse-hubzilla-2020ea23b106c159a705c26e6c79156aafde75ba.tar.bz2
volse-hubzilla-2020ea23b106c159a705c26e6c79156aafde75ba.zip
Mods to script runned via CLI to permits to run also included
-rw-r--r--include/directory.php4
-rw-r--r--include/notifier.php39
-rw-r--r--include/poller.php10
-rw-r--r--include/queue.php6
4 files changed, 33 insertions, 26 deletions
diff --git a/include/directory.php b/include/directory.php
index 5f835dc4b..4fdcf4928 100644
--- a/include/directory.php
+++ b/include/directory.php
@@ -11,7 +11,7 @@
if($argc != 2)
- exit;
+ return;
load_config('system');
@@ -24,5 +24,5 @@
fetch_url($dir . '?url=' . bin2hex($argv[1]));
- exit;
+ return;
diff --git a/include/notifier.php b/include/notifier.php
index 4efdad4ce..bb38ecf51 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -16,7 +16,7 @@
require_once('include/bbcode.php');
if($argc < 3)
- exit;
+ return;
$a->set_baseurl(get_config('system','url'));
@@ -29,8 +29,9 @@
case 'mail':
default:
$item_id = intval($argv[2]);
- if(! $item_id)
- killme();
+ if(! $item_id){
+ killme(); return;
+ }
break;
}
@@ -42,8 +43,9 @@
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
intval($item_id)
);
- if(! count($message))
- killme();
+ if(! count($message)){
+ killme(); return;
+ }
$uid = $message[0]['uid'];
$recipients[] = $message[0]['contact-id'];
$item = $message[0];
@@ -55,8 +57,9 @@
$r = q("SELECT `parent`, `uid`, `edited` FROM `item` WHERE `id` = %d LIMIT 1",
intval($item_id)
);
- if(! count($r))
- killme();
+ if(! count($r)){
+ killme(); return;
+ }
$parent_id = $r[0]['parent'];
$uid = $r[0]['uid'];
@@ -66,8 +69,9 @@
intval($parent_id)
);
- if(! count($items))
- killme();
+ if(! count($items)){
+ killme(); return;
+ }
}
$r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags`
@@ -78,9 +82,9 @@
if(count($r))
$owner = $r[0];
- else
- killme();
-
+ else {
+ killme(); return;
+ }
$hub = get_config('system','huburl');
// If this is a public conversation, notify the feed hub
@@ -150,8 +154,9 @@
$r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0");
- if( ! count($r))
- killme();
+ if( ! count($r)){
+ killme(); return;
+ }
$contacts = $r;
}
@@ -248,9 +253,9 @@
$r = q("SELECT * FROM `contact` WHERE `id` IN ( %s ) AND `blocked` = 0 ",
dbesc($recip_str)
);
- if(! count($r))
- killme();
-
+ if(! count($r)){
+ killme(); return;
+ }
// delivery loop
require_once('include/salmon.php');
diff --git a/include/poller.php b/include/poller.php
index 024b9fbcd..a4bc60767 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -19,11 +19,12 @@
$a->set_baseurl(get_config('system','url'));
logger('poller: start');
-
+
// run queue delivery process in the background
$php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- proc_close(proc_open("\"$php_path\" \"include/queue.php\" &", array(), $foo));
+ //proc_close(proc_open("\"$php_path\" \"include/queue.php\" &", array(), $foo));
+ proc_run($php_path,"include/queue.php");
$hub_update = false;
@@ -46,8 +47,9 @@
$sql_extra
AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 ORDER BY RAND()");
- if(! count($contacts))
- killme();
+ if(! count($contacts)){
+ killme(); return;
+ }
foreach($contacts as $contact) {
diff --git a/include/queue.php b/include/queue.php
index 96ddfa81b..fae93e328 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -50,9 +50,9 @@ function remove_queue_item($id) {
$r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ");
- if(! count($r))
- killme();
-
+ if(! count($r)){
+ killme(); return;
+ }
// delivery loop
require_once('include/salmon.php');