Upgrade BackgroundTask to support modified environment

This commit is contained in:
2011-10-06 22:54:07 +01:00
parent de1519c5bb
commit d7dfdadc14

View File

@@ -6,10 +6,10 @@ class SihnonFramework_BackgroundTask {
}
public static function run($command) {
public static function run($command, $cwd=null, $env=null) {
SihnonFramework_LogEntry::debug(SihnonFramework_Main::instance()->log(), "Running background task: {$command} &", 'default');
$pipes = array();
$pid = proc_open($command . ' &', array(), $pipes);
$pid = proc_open($command . ' &', array(), $pipes, $cwd, $env);
proc_close($pid);
}