src/Application.php
public function setBasePath($path)
    {
        $p = realpath($path);
        if ($p !== false && is_dir($p)) {
            $this->_basePath = $p;
        } else {
            throw new Exception("The directory does not exist: $path");
        }
    }
public function setBasePath($path)
    {
        $p = realpath($path);
        if ($p !== false && is_dir($p)) {
            $this->_basePath = $p;
        } else {
            throw new Exception("The directory does not exist: $path");
        }
    }
Sets the root directory of the application.
This method can only be invoked at the beginning of the constructor.

@param string $path the root directory of the application.
@throws InvalidParamException if the directory does not exist.