public function beginProcess($cmd, $descriptors, $cwd = null, $env = null, $options = null)
    {
        if (isset($this->_process)) {
            throw new CException('Failed to start process. Process is already running.');
        }
        echo "Running command: $cmd ... ";
        $this->_process = proc_open($cmd, $descriptors, $this->_pipes, $cwd, $env, $options);
        if (!is_resource($this->_process)) {
            throw new CException('Failed to start process. Process could not be opened.');
        }
    }