classes/phing/tasks/system/TouchTask.php
public function main()
    {
        $savedMillis = $this->millis;

        if ($this->file === null && count($this->filesets) === 0 && count($this->filelists) === 0) {
            throw new BuildException("Specify at least one source - a file, a fileset or a filelist.");
        }

        if ($this->file !== null && $this->file->exists() && $this->file->isDirectory()) {
            throw new BuildException("Use a fileset to touch directories.");
        }

        try { // try to touch file
            if ($this->dateTime !== null) {
                $this->setMillis(strtotime($this->dateTime));
                if ($this->millis < 0) {
                    throw new BuildException("Date of {$this->dateTime} results in negative milliseconds value relative to epoch (January 1, 1970, 00:00:00 GMT).");
                }
            }
            $this->_touch();
        } catch (Exception $ex) {
            throw new BuildException("Error touch()ing file", $ex, $this->getLocation());
        }

        $this->millis = $savedMillis;
    }
public function main()
    {
        $savedMillis = $this->millis;

        if ($this->file === null && count($this->filesets) === 0 && count($this->filelists) === 0) {
            throw new BuildException("Specify at least one source - a file, a fileset or a filelist.");
        }

        if ($this->file !== null && $this->file->exists() && $this->file->isDirectory()) {
            throw new BuildException("Use a fileset to touch directories.");
        }

        try { // try to touch file
            if ($this->dateTime !== null) {
                $this->setMillis(strtotime($this->dateTime));
                if ($this->millis < 0) {
                    throw new BuildException("Date of {$this->dateTime} results in negative milliseconds value relative to epoch (January 1, 1970, 00:00:00 GMT).");
                }
            }
            $this->_touch();
        } catch (Exception $ex) {
            throw new BuildException("Error touch()ing file", $ex, $this->getLocation());
        }

        $this->millis = $savedMillis;
    }
public function main ( ) { $ savedMillis = $ this -> millis ; if ( $ this -> file === null && count ( $ this -> filesets ) === 0 && count ( $ this -> filelists ) === 0 ) { throw new BuildException ( "Specify at least one source - a file, a fileset or a filelist." ) ; } if ( $ this -> file !== null && $ this -> file -> exists ( ) && $ this -> file -> isDirectory ( ) ) { throw new BuildException ( "Use a fileset to touch directories." ) ; } try { // try to touch file if ( $ this -> dateTime !== null ) { $ this -> setMillis ( strtotime ( $ this -> dateTime ) ) ; if ( $ this -> millis < 0 ) { throw new BuildException ( "Date of {$this->dateTime} results in negative milliseconds value relative to epoch (January 1, 1970, 00:00:00 GMT)." ) ; } } $ this -> _touch ( ) ; } catch ( Exception $ ex ) { throw new BuildException ( "Error touch()ing file" , $ ex , $ this -> getLocation ( ) ) ; } $ this -> millis = $ savedMillis ; }
Execute the touch operation.

@throws BuildException
@throws IOException
Execute the touch operation .