aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-01-24 22:00:02 +0100
committerfabrixxm <fabrix.xm@gmail.com>2011-01-24 22:00:02 +0100
commite9251499dd63523a552bc3bf6274e3b851cba4c8 (patch)
tree0c842c1c3c54fa544b3d505574d118c8843d7d28 /boot.php
parenta282042ffc69ce910ac92118907305ed38dbd869 (diff)
downloadvolse-hubzilla-e9251499dd63523a552bc3bf6274e3b851cba4c8.tar.gz
volse-hubzilla-e9251499dd63523a552bc3bf6274e3b851cba4c8.tar.bz2
volse-hubzilla-e9251499dd63523a552bc3bf6274e3b851cba4c8.zip
Added proc_run() and modified all occurrence of proc_close(proc_open()) to use proc_run()
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 86ad29296..207faaf48 100644
--- a/boot.php
+++ b/boot.php
@@ -2215,3 +2215,33 @@ function link_compare($a,$b) {
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));
+}}
+
+?>
+