public function runProcess($output_file = '/dev/null', $append = false)
    {
        switch (PHP_OS) {
            case 'Windows':
                shell_exec(sprintf('%s &', $this->function_code, $output_file));
                break;
            case 'Linux':
                $this->pid = (int)shell_exec(sprintf('php -r "%s" %s %s 2>&1 & echo $!', str_replace('"', '\"', $this->function_code), ($append) ? '>>' : '>', $output_file));
                break;
            default:
                throw new RuntimeException(sprintf(
                    'Could not execute command "%s" because operating system "%s" is not supported', $this->function_code, PHP_OS
                ));
        }
    }
public function runProcess($output_file = '/dev/null', $append = false)
    {
        switch (PHP_OS) {
            case 'Windows':
                shell_exec(sprintf('%s &', $this->function_code, $output_file));
                break;
            case 'Linux':
                $this->pid = (int)shell_exec(sprintf('php -r "%s" %s %s 2>&1 & echo $!', str_replace('"', '\"', $this->function_code), ($append) ? '>>' : '>', $output_file));
                break;
            default:
                throw new RuntimeException(sprintf(
                    'Could not execute command "%s" because operating system "%s" is not supported', $this->function_code, PHP_OS
                ));
        }
    }
public function runProcess ( $ output_file = '/dev/null' , $ append = false ) { switch ( PHP_OS ) { case 'Windows' : shell_exec ( sprintf ( '%s &' , $ this -> function_code , $ output_file ) ) ; break ; case 'Linux' : $ this -> pid = ( int ) shell_exec ( sprintf ( 'php -r "%s" %s %s 2>&1 & echo $!' , str_replace ( '"' , '\"' , $ this -> function_code ) , ( $ append ) ? '>>' : '>' , $ output_file ) ) ; break ; default : throw new RuntimeException ( sprintf ( 'Could not execute command "%s" because operating system "%s" is not supported' , $ this -> function_code , PHP_OS ) ) ; } }
Runs the function in a background process.

@param string $output_file File to write the output of the process to
defaults is /dev/null
Windows do not us it, so no effect on that OS
@param bool   $append      the output to file
Runs the function in a background process .