// 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");
}
}
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);
// 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'",
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
}
$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");
}
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');
// 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
// 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;
}
}
$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
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;
}
);
}
-
- $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
}
}
}
-
-
-
-
-
- $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 {
);
$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");
}
}
}
$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");
}
}
$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");
}
}
);
// 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);
);
// 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
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");
}
}
}
}
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");
}
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");
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;