return true;
return false;
}}
+
+
+/**
+ *
+ * Wrap calls to proc_close(proc_open()) and call hook
+ * so plugins can take part in process :)
+ *
+ * args:
+ * $cmd program to run
+ * next args are passed as $cmd command line
+ *
+ * e.g.: proc_run("ls","-la","/tmp");
+ *
+ * $cmd and string args are surrounded with ""
+ */
+if(! function_exists('run_proc')) {
+function proc_run($cmd){
+ $args = func_get_args();
+ foreach ($args as &$arg){
+ if(is_string($arg)) $arg='"'.$arg.'"';
+ }
+ $cmdline = implode($args," ");
+
+ call_hooks("proc_run", $args);
+
+ proc_close(proc_open($cmdline." &",array(),$foo));
+}}
+
+?>
+
$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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"activity\" \"$i\" &", array(),$foo));
+ proc_run($php_path,"include/notifier.php","activity","$i");
}
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &",
- array(),$foo));
-
+ //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &", array(),$foo));
+ proc_run($php_path,"include/notifier.php","comment-import","$posted_id");
+
if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
require_once('bbcode.php');
$from = stripslashes($datarray['author-name']);
// 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_close(proc_open("\"$php_path\" \"include/poller.php\" \"$contact_id\" &", array(), $foo));
+ proc_run($php_path,"include/poller.php","$contact_id");
// create a follow slap
logger('mod_item: notifier invoked: ' . "\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &");
- proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &",
- array(),$foo));
+ proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
$datarray['id'] = $post_id;
// 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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" &", array(), $foo));
+ proc_run($php_path,"include/notifier.php","drop","$drop_id");
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
return; //NOTREACHED
);
$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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo));
+ proc_run($php_path,"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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo));
+ proc_run($php_path,"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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"mail\" \"$post_id\" &", array(),$foo));
+ proc_run($php_path,"include/notifier.php","mail","$post_id");
notice( t('Message sent.') . EOL );
}
else {
// 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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",array(),$foo));
+ proc_run($php_path,"include/notifier.php","drop","$drop_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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ", array(),$foo));
+ proc_run($php_path,"include/notifier.php","drop","$drop_id");
}
}
$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_close(proc_open("\"$php_path\" \"include/notifier.php\" \"tag\" \"$item_id\" & ",array(),$foo));
+ proc_run($php_path,"include/notifier.php","tag","$item_id");
}
}
$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_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo));
+ proc_run($php_path,"include/directory.php","$url");
}
else
notice( t('Unable to process image') . EOL);
$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_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &", array(),$foo));
+ proc_run($php_path,"include/directory.php","$url");
}
}
}
$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_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo));
+ proc_run($php_path,"include/directory.php","$url");
}
$_SESSION['theme'] = $theme;