aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-23 15:16:12 -0800
committerFriendika <info@friendika.com>2011-02-23 15:16:12 -0800
commit755c2245e8184ceee2ba3382e4f60143da31e6df (patch)
tree0098c6c22248135533a8fec4768090e9463b7b68
parentfdc469ae4ce385e21c396b76628e0d427e173e92 (diff)
downloadvolse-hubzilla-755c2245e8184ceee2ba3382e4f60143da31e6df.tar.gz
volse-hubzilla-755c2245e8184ceee2ba3382e4f60143da31e6df.tar.bz2
volse-hubzilla-755c2245e8184ceee2ba3382e4f60143da31e6df.zip
move php path setting inside proc_run
-rw-r--r--addon/poormancron/poormancron.php3
-rw-r--r--boot.php3
-rw-r--r--include/poller.php3
-rw-r--r--mod/contacts.php4
-rw-r--r--mod/dfrn_confirm.php7
-rw-r--r--mod/dfrn_notify.php4
-rw-r--r--mod/follow.php4
-rw-r--r--mod/item.php10
-rw-r--r--mod/like.php10
-rw-r--r--mod/message.php9
-rw-r--r--mod/photos.php13
-rw-r--r--mod/profile_photo.php8
-rw-r--r--mod/profiles.php4
-rw-r--r--mod/register.php3
-rw-r--r--mod/regmod.php3
-rw-r--r--mod/settings.php4
16 files changed, 25 insertions, 67 deletions
diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php
index c31d2772c..830c10ddf 100644
--- a/addon/poormancron/poormancron.php
+++ b/addon/poormancron/poormancron.php
@@ -27,8 +27,7 @@ function poormancron_hook($a,&$b) {
// 300 secs, 5 mins
if (!$lastupdate || ($now-$lastupdate)>300) {
set_config('poormancron','lastupdate', $now);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- proc_run($php_path,"include/poller.php");
+ proc_run('php',"include/poller.php");
}
}
diff --git a/boot.php b/boot.php
index 530baa7b9..d9786edcd 100644
--- a/boot.php
+++ b/boot.php
@@ -2434,6 +2434,9 @@ if(! function_exists('proc_run')) {
function proc_run($cmd){
$args = func_get_args();
call_hooks("proc_run", $args);
+
+ if(count($args) && $args[0] === 'php')
+ $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
foreach ($args as $arg){
$arg = escapeshellarg($arg);
diff --git a/include/poller.php b/include/poller.php
index 66df080a9..d54c88e05 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -27,8 +27,7 @@ function poller_run($argv, $argc){
// 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_run($php_path,"include/queue.php");
+ proc_run('php',"include/queue.php");
// clear old cache
q("DELETE FROM `cache` WHERE `updated`<'%s'",
diff --git a/mod/contacts.php b/mod/contacts.php
index 36f42f8e5..8e069b2bd 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -124,9 +124,7 @@ function contacts_content(&$a) {
if($cmd === 'update') {
// pull feed and consume it, which should subscribe to the hub.
-
- $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- proc_run($php_path,"include/poller.php","$contact_id");
+ proc_run('php',"include/poller.php","$contact_id");
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
// NOTREACHED
}
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 24e8bf106..1b42c13b8 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -435,11 +435,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$arr['last-child'] = 1;
$i = item_store($arr);
-
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"activity\" \"$i\" &", array(),$foo));
- proc_run($php_path,"include/notifier.php","activity","$i");
+ if($i)
+ proc_run('php',"include/notifier.php","activity","$i");
}
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index cd7b0cff0..010272739 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -369,9 +369,7 @@ function dfrn_notify_post(&$a) {
if($posted_id && $parent) {
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-
- proc_run($php_path,"include/notifier.php","comment-import","$posted_id");
+ proc_run('php',"include/notifier.php","comment-import","$posted_id");
if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
require_once('bbcode.php');
diff --git a/mod/follow.php b/mod/follow.php
index 28441eae8..f3bd84669 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -253,9 +253,7 @@ function follow_post(&$a) {
// pull feed and consume it, which should subscribe to the hub.
- $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- //proc_close(proc_open("\"$php_path\" \"include/poller.php\" \"$contact_id\" &", array(), $foo));
- proc_run($php_path,"include/poller.php","$contact_id");
+ proc_run('php',"include/poller.php","$contact_id");
// create a follow slap
diff --git a/mod/item.php b/mod/item.php
index 8c6b181c0..c2487435e 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -460,11 +460,7 @@ function item_post(&$a) {
// NOTREACHED
}
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-
- logger('mod_item: notifier invoked: ' . "\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &");
-
- proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
+ proc_run('php', "include/notifier.php", $notify_type, "$post_id");
$datarray['id'] = $post_id;
@@ -595,12 +591,10 @@ function item_content(&$a) {
}
}
$drop_id = intval($item['id']);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
// send the notification upstream/downstream as the case may be
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" &", array(), $foo));
- proc_run($php_path,"include/notifier.php","drop","$drop_id");
+ proc_run('php',"include/notifier.php","drop","$drop_id");
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
//NOTREACHED
diff --git a/mod/like.php b/mod/like.php
index c78c1f030..3a8ca4b7d 100644
--- a/mod/like.php
+++ b/mod/like.php
@@ -101,9 +101,7 @@ function like_content(&$a) {
intval($r[0]['id'])
);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo));
- proc_run($php_path,"include/notifier.php","like","$post_id");
+ proc_run('php',"include/notifier.php","like","$post_id");
return;
}
@@ -173,11 +171,7 @@ EOT;
);
}
-
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo));
- proc_run($php_path,"include/notifier.php","like","$post_id");
+ proc_run('php',"include/notifier.php","like","$post_id");
return; // NOTREACHED
} \ No newline at end of file
diff --git a/mod/message.php b/mod/message.php
index ef3be2c5e..466b0befa 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -96,16 +96,9 @@ function message_post(&$a) {
}
}
}
-
-
-
-
-
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
if($post_id) {
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"mail\" \"$post_id\" &", array(),$foo));
- proc_run($php_path,"include/notifier.php","mail","$post_id");
+ proc_run('php',"include/notifier.php","mail","$post_id");
notice( t('Message sent.') . EOL );
}
else {
diff --git a/mod/photos.php b/mod/photos.php
index d4835ba5e..bd48cfc9f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -182,13 +182,11 @@ foreach($_FILES AS $key => $val) {
);
$drop_id = intval($rr['id']);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
// send the notification upstream/downstream as the case may be
if($rr['visible'])
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",array(),$foo));
- proc_run($php_path,"include/notifier.php","drop","$drop_id");
+ proc_run('php',"include/notifier.php","drop","$drop_id");
}
}
}
@@ -232,11 +230,9 @@ foreach($_FILES AS $key => $val) {
$url = $a->get_baseurl();
$drop_id = intval($i[0]['id']);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
if($i[0]['visible'])
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ", array(),$foo));
- proc_run($php_path,"include/notifier.php","drop","$drop_id");
+ proc_run('php',"include/notifier.php","drop","$drop_id");
}
}
@@ -474,9 +470,8 @@ foreach($_FILES AS $key => $val) {
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="image/jpeg" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.jpg' . '" />') . '</link></target>';
$item_id = item_store($arr);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"tag\" \"$item_id\" & ",array(),$foo));
- proc_run($php_path,"include/notifier.php","tag","$item_id");
+ if($item_id)
+ proc_run('php',"include/notifier.php","tag","$item_id");
}
}
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 4f0d567f4..0f84a85c9 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -87,11 +87,9 @@ function profile_photo_post(&$a) {
);
// Update global directory in background
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $_SESSION['my_url'];
if($url && strlen(get_config('system','directory_submit_url')))
- //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo));
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
}
else
notice( t('Unable to process image') . EOL);
@@ -169,11 +167,9 @@ function profile_photo_content(&$a) {
);
// Update global directory in background
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $_SESSION['my_url'];
if($url && strlen(get_config('system','directory_submit_url')))
- //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo));
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
goaway($a->get_baseurl() . '/profiles');
return; // NOTREACHED
diff --git a/mod/profiles.php b/mod/profiles.php
index d74219501..4e3f03799 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -200,11 +200,9 @@ function profiles_post(&$a) {
if($is_default) {
// Update global directory in background
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $_SESSION['my_url'];
if($url && strlen(get_config('system','directory_submit_url')))
- //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &", array(),$foo));
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
}
}
}
diff --git a/mod/register.php b/mod/register.php
index d88536232..97038def0 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -292,9 +292,8 @@ function register_post(&$a) {
}
if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) {
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $a->get_baseurl() . "/profile/$nickname";
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
}
diff --git a/mod/regmod.php b/mod/regmod.php
index f662902d8..00cfa06e2 100644
--- a/mod/regmod.php
+++ b/mod/regmod.php
@@ -74,10 +74,9 @@ function regmod_content(&$a) {
intval($user[0]['uid'])
);
if(count($r) && $r[0]['net-publish']) {
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $a->get_baseurl() . '/profile/' . $user[0]['nickname'];
if($url && strlen(get_config('system','directory_submit_url')))
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
}
$email_tpl = load_view_file("view/register_open_eml.tpl");
diff --git a/mod/settings.php b/mod/settings.php
index dbbac8bde..ebe07612e 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -179,11 +179,9 @@ function settings_post(&$a) {
if($old_visibility != $net_publish) {
// Update global directory in background
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
$url = $_SESSION['my_url'];
if($url && strlen(get_config('system','directory_submit_url')))
- //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo));
- proc_run($php_path,"include/directory.php","$url");
+ proc_run('php',"include/directory.php","$url");
}
$_SESSION['theme'] = $theme;