classes/phing/tasks/ext/RSTTask.php
protected function renderFile($tool, $source, $targetFile)
    {
        if ($this->uptodate && file_exists($targetFile)
            && filemtime($source) <= filemtime($targetFile)
        ) {
            //target is up to date
            return;
        }
        //work around a bug in php by replacing /./ with /
        $targetDir = str_replace('/./', '/', dirname($targetFile));
        if (!is_dir($targetDir)) {
            $this->log("Creating directory '$targetDir'", Project::MSG_VERBOSE);
            mkdir($targetDir, $this->mode, true);
        }

        $cmd = $tool
            . ' --exit-status=2'
            . ' ' . $this->toolParam
            . ' ' . escapeshellarg($source)
            . ' ' . escapeshellarg($targetFile)
            . ' 2>&1';

        $this->log('command: ' . $cmd, Project::MSG_VERBOSE);
        exec($cmd, $arOutput, $retval);
        if ($retval != 0) {
            $this->log(implode("\n", $arOutput), Project::MSG_INFO);
            throw new BuildException('Rendering rST failed');
        }
        $this->log(implode("\n", $arOutput), Project::MSG_DEBUG);
    }
protected function renderFile($tool, $source, $targetFile)
    {
        if ($this->uptodate && file_exists($targetFile)
            && filemtime($source) <= filemtime($targetFile)
        ) {
            //target is up to date
            return;
        }
        //work around a bug in php by replacing /./ with /
        $targetDir = str_replace('/./', '/', dirname($targetFile));
        if (!is_dir($targetDir)) {
            $this->log("Creating directory '$targetDir'", Project::MSG_VERBOSE);
            mkdir($targetDir, $this->mode, true);
        }

        $cmd = $tool
            . ' --exit-status=2'
            . ' ' . $this->toolParam
            . ' ' . escapeshellarg($source)
            . ' ' . escapeshellarg($targetFile)
            . ' 2>&1';

        $this->log('command: ' . $cmd, Project::MSG_VERBOSE);
        exec($cmd, $arOutput, $retval);
        if ($retval != 0) {
            $this->log(implode("\n", $arOutput), Project::MSG_INFO);
            throw new BuildException('Rendering rST failed');
        }
        $this->log(implode("\n", $arOutput), Project::MSG_DEBUG);
    }
protected function renderFile ( $ tool , $ source , $ targetFile ) { if ( $ this -> uptodate && file_exists ( $ targetFile ) && filemtime ( $ source ) <= filemtime ( $ targetFile ) ) { //target is up to date return ; } //work around a bug in php by replacing /./ with / $ targetDir = str_replace ( '/./' , '/' , dirname ( $ targetFile ) ) ; if ( ! is_dir ( $ targetDir ) ) { $ this -> log ( "Creating directory '$targetDir'" , Project :: MSG_VERBOSE ) ; mkdir ( $ targetDir , $ this -> mode , true ) ; } $ cmd = $ tool . ' --exit-status=2' . ' ' . $ this -> toolParam . ' ' . escapeshellarg ( $ source ) . ' ' . escapeshellarg ( $ targetFile ) . ' 2>&1' ; $ this -> log ( 'command: ' . $ cmd , Project :: MSG_VERBOSE ) ; exec ( $ cmd , $ arOutput , $ retval ) ; if ( $ retval != 0 ) { $ this -> log ( implode ( "\n" , $ arOutput ) , Project :: MSG_INFO ) ; throw new BuildException ( 'Rendering rST failed' ) ; } $ this -> log ( implode ( "\n" , $ arOutput ) , Project :: MSG_DEBUG ) ; }
Renders a single file with the rST tool.

@param string $tool conversion tool to use
@param string $source rST source file
@param string $targetFile target file name

@return void

@throws BuildException When the conversion fails
Renders a single file with the rST tool .