classes/phing/tasks/system/MkdirTask.php
public function main()
    {
        if ($this->dir === null) {
            throw new BuildException("dir attribute is required", $this->getLocation());
        }
        if ($this->dir->isFile()) {
            throw new BuildException(
                "Unable to create directory as a file already exists with that name: " . $this->dir->getAbsolutePath()
            );
        }
        if (!$this->dir->exists()) {
            $result = $this->dir->mkdirs($this->mode);
            if (!$result) {
                if ($this->dir->exists()) {
                    $this->log("A different process or task has already created " . $this->dir->getAbsolutePath());

                    return;
                }
                $msg = "Directory " . $this->dir->getAbsolutePath() . " creation was not successful for an unknown reason";
                throw new BuildException($msg, $this->getLocation());
            }
            $this->log("Created dir: " . $this->dir->getAbsolutePath());
        }
    }
public function main()
    {
        if ($this->dir === null) {
            throw new BuildException("dir attribute is required", $this->getLocation());
        }
        if ($this->dir->isFile()) {
            throw new BuildException(
                "Unable to create directory as a file already exists with that name: " . $this->dir->getAbsolutePath()
            );
        }
        if (!$this->dir->exists()) {
            $result = $this->dir->mkdirs($this->mode);
            if (!$result) {
                if ($this->dir->exists()) {
                    $this->log("A different process or task has already created " . $this->dir->getAbsolutePath());

                    return;
                }
                $msg = "Directory " . $this->dir->getAbsolutePath() . " creation was not successful for an unknown reason";
                throw new BuildException($msg, $this->getLocation());
            }
            $this->log("Created dir: " . $this->dir->getAbsolutePath());
        }
    }
public function main ( ) { if ( $ this -> dir === null ) { throw new BuildException ( "dir attribute is required" , $ this -> getLocation ( ) ) ; } if ( $ this -> dir -> isFile ( ) ) { throw new BuildException ( "Unable to create directory as a file already exists with that name: " . $ this -> dir -> getAbsolutePath ( ) ) ; } if ( ! $ this -> dir -> exists ( ) ) { $ result = $ this -> dir -> mkdirs ( $ this -> mode ) ; if ( ! $ result ) { if ( $ this -> dir -> exists ( ) ) { $ this -> log ( "A different process or task has already created " . $ this -> dir -> getAbsolutePath ( ) ) ; return ; } $ msg = "Directory " . $ this -> dir -> getAbsolutePath ( ) . " creation was not successful for an unknown reason" ; throw new BuildException ( $ msg , $ this -> getLocation ( ) ) ; } $ this -> log ( "Created dir: " . $ this -> dir -> getAbsolutePath ( ) ) ; } }
create the directory and all parents

@throws BuildException if dir is somehow invalid, or creation failed.
create the directory and all parents