public function execute(Closure $closure)
    {
        $temporaryFile = tempnam(sys_get_temp_dir(), 'covert');

        $temporaryContent = '<?php'.PHP_EOL.PHP_EOL;

        if ($this->autoload !== false) {
            $temporaryContent .= "require('$this->autoload');".PHP_EOL.PHP_EOL;
        }

        $temporaryContent .= FunctionReflection::toString($closure).PHP_EOL.PHP_EOL;
        $temporaryContent .= 'unlink(__FILE__);'.PHP_EOL.PHP_EOL;
        $temporaryContent .= 'exit;';

        file_put_contents($temporaryFile, $temporaryContent);

        $this->processId = $this->executeFile($temporaryFile);

        return $this;
    }
public function execute(Closure $closure)
    {
        $temporaryFile = tempnam(sys_get_temp_dir(), 'covert');

        $temporaryContent = '<?php'.PHP_EOL.PHP_EOL;

        if ($this->autoload !== false) {
            $temporaryContent .= "require('$this->autoload');".PHP_EOL.PHP_EOL;
        }

        $temporaryContent .= FunctionReflection::toString($closure).PHP_EOL.PHP_EOL;
        $temporaryContent .= 'unlink(__FILE__);'.PHP_EOL.PHP_EOL;
        $temporaryContent .= 'exit;';

        file_put_contents($temporaryFile, $temporaryContent);

        $this->processId = $this->executeFile($temporaryFile);

        return $this;
    }
public function execute ( Closure $ closure ) { $ temporaryFile = tempnam ( sys_get_temp_dir ( ) , 'covert' ) ; $ temporaryContent = '<?php' . PHP_EOL . PHP_EOL ; if ( $ this -> autoload !== false ) { $ temporaryContent .= "require('$this->autoload');" . PHP_EOL . PHP_EOL ; } $ temporaryContent .= FunctionReflection :: toString ( $ closure ) . PHP_EOL . PHP_EOL ; $ temporaryContent .= 'unlink(__FILE__);' . PHP_EOL . PHP_EOL ; $ temporaryContent .= 'exit;' ; file_put_contents ( $ temporaryFile , $ temporaryContent ) ; $ this -> processId = $ this -> executeFile ( $ temporaryFile ) ; return $ this ; }
Execute the process.

@param \Closure $closure The anonyouse function to execute.

@return void
Execute the process .