aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-28 18:50:20 -0800
committerFriendika <info@friendika.com>2011-01-28 18:50:20 -0800
commit26cc2e02fe6e075cd35a3069edbc006219f5b435 (patch)
treeb687508bd7247100ac0dd51ecf36aed9ea97d5cd /boot.php
parent5d77bd9489763721b8f3e4a51c8cef1181276157 (diff)
parent302acda0890a472916b759e6340ce77d9803f105 (diff)
downloadvolse-hubzilla-26cc2e02fe6e075cd35a3069edbc006219f5b435.tar.gz
volse-hubzilla-26cc2e02fe6e075cd35a3069edbc006219f5b435.tar.bz2
volse-hubzilla-26cc2e02fe6e075cd35a3069edbc006219f5b435.zip
Merge branch 'fabrixxm-master'
Conflicts: boot.php
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php27
1 files changed, 25 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 3cc98cc9b..223c9416d 100644
--- a/boot.php
+++ b/boot.php
@@ -1655,7 +1655,6 @@ function attribute_contains($attr,$s) {
if(! function_exists('logger')) {
function logger($msg,$level = 0) {
-
$debugging = get_config('system','debugging');
$loglevel = intval(get_config('system','loglevel'));
$logfile = get_config('system','logfile');
@@ -2225,7 +2224,31 @@ function prepare_body($item) {
$s = smilies(bbcode($item['body']));
return $s;
+}}
+/**
+ *
+ * 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();
+ call_hooks("proc_run", $args);
+
+ foreach ($args as &$arg){
+ if(is_string($arg)) $arg='"'.$arg.'"';
+ }
+ $cmdline = implode($args," ");
+ proc_close(proc_open($cmdline." &",array(),$foo));
+}}
-}} \ No newline at end of file