public function setDocumentRoot($path)
    {
        if (file_exists($path)) {
            $this->document_root = realpath($path);
        } elseif (file_exists(DirectoryHelper::slashDirname($this->getRootDirectory()) . $path)) {
            $this->document_root = DirectoryHelper::slashDirname($this->getRootDirectory()) . $path;
        } else {
            throw new \InvalidArgumentException(
                sprintf('Document root path "%s" doesn\'t exist!', $path)
            );
        }
        return $this;
    }
public function setDocumentRoot($path)
    {
        if (file_exists($path)) {
            $this->document_root = realpath($path);
        } elseif (file_exists(DirectoryHelper::slashDirname($this->getRootDirectory()) . $path)) {
            $this->document_root = DirectoryHelper::slashDirname($this->getRootDirectory()) . $path;
        } else {
            throw new \InvalidArgumentException(
                sprintf('Document root path "%s" doesn\'t exist!', $path)
            );
        }
        return $this;
    }
public function setDocumentRoot ( $ path ) { if ( file_exists ( $ path ) ) { $ this -> document_root = realpath ( $ path ) ; } elseif ( file_exists ( DirectoryHelper :: slashDirname ( $ this -> getRootDirectory ( ) ) . $ path ) ) { $ this -> document_root = DirectoryHelper :: slashDirname ( $ this -> getRootDirectory ( ) ) . $ path ; } else { throw new \ InvalidArgumentException ( sprintf ( 'Document root path "%s" doesn\'t exist!' , $ path ) ) ; } return $ this ; }
Set the document root directory

@param   string  $path   The path of the document root directory
@return  self
@throws  \InvalidArgumentException if the directory was not found
Set the document root directory