+
+ function proc_run($args) {
+
+ // Add the php path if it is a php call
+ if (count($args) && $args[0] === 'php')
+ $args[0] = ((x($this->config,'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php');
+
+ // add baseurl to args. cli scripts can't construct it
+ $args[] = $this->get_baseurl();
+
+ for($x = 0; $x < count($args); $x ++)
+ $args[$x] = escapeshellarg($args[$x]);
+
+ $cmdline = implode($args," ");
+
+ if(get_config('system','proc_windows'))
+ proc_close(proc_open('cmd /c start /b ' . $cmdline,array(),$foo,dirname(__FILE__)));
+ else
+ proc_close(proc_open($cmdline." &",array(),$foo,dirname(__FILE__)));
+
+ }