classes/phing/tasks/system/ExecTask.php
protected function prepare()
    {
        if ($this->dir === null) {
            $this->dir = $this->getProject()->getBasedir();
        }

        if ($this->commandline->getExecutable() === null) {
            throw new BuildException(
                'ExecTask: Please provide "executable"'
            );
        }

        // expand any symbolic links first
        try {
            if (!$this->dir->getCanonicalFile()->exists()) {
                throw new BuildException(
                    "The directory '" . (string) $this->dir . "' does not exist"
                );
            }
            if (!$this->dir->getCanonicalFile()->isDirectory()) {
                throw new BuildException(
                    "'" . (string) $this->dir . "' is not a directory"
                );
            }
        } catch (IOException $e) {
            throw new BuildException(
                "'" . (string) $this->dir . "' is not a readable directory"
            );
        }
        $this->currdir = getcwd();
        @chdir($this->dir->getPath());

        $this->commandline->setEscape($this->escape);
    }
protected function prepare()
    {
        if ($this->dir === null) {
            $this->dir = $this->getProject()->getBasedir();
        }

        if ($this->commandline->getExecutable() === null) {
            throw new BuildException(
                'ExecTask: Please provide "executable"'
            );
        }

        // expand any symbolic links first
        try {
            if (!$this->dir->getCanonicalFile()->exists()) {
                throw new BuildException(
                    "The directory '" . (string) $this->dir . "' does not exist"
                );
            }
            if (!$this->dir->getCanonicalFile()->isDirectory()) {
                throw new BuildException(
                    "'" . (string) $this->dir . "' is not a directory"
                );
            }
        } catch (IOException $e) {
            throw new BuildException(
                "'" . (string) $this->dir . "' is not a readable directory"
            );
        }
        $this->currdir = getcwd();
        @chdir($this->dir->getPath());

        $this->commandline->setEscape($this->escape);
    }
protected function prepare ( ) { if ( $ this -> dir === null ) { $ this -> dir = $ this -> getProject ( ) -> getBasedir ( ) ; } if ( $ this -> commandline -> getExecutable ( ) === null ) { throw new BuildException ( 'ExecTask: Please provide "executable"' ) ; } // expand any symbolic links first try { if ( ! $ this -> dir -> getCanonicalFile ( ) -> exists ( ) ) { throw new BuildException ( "The directory '" . ( string ) $ this -> dir . "' does not exist" ) ; } if ( ! $ this -> dir -> getCanonicalFile ( ) -> isDirectory ( ) ) { throw new BuildException ( "'" . ( string ) $ this -> dir . "' is not a directory" ) ; } } catch ( IOException $ e ) { throw new BuildException ( "'" . ( string ) $ this -> dir . "' is not a readable directory" ) ; } $ this -> currdir = getcwd ( ) ; @ chdir ( $ this -> dir -> getPath ( ) ) ; $ this -> commandline -> setEscape ( $ this -> escape ) ; }
Prepares the command building and execution, i.e.
changes to the specified directory.

@throws BuildException
@return void
Prepares the command building and execution i . e . changes to the specified directory .