src/Core/Application.php
public function setBasePath($path)
	{
		$path = Yii::getAlias($path);
		$p = realpath($path);
		if ($p !== false && is_dir($p)) {
			$this->_basePath = $p;
		} else {
			throw new InvalidParamException("The directory does not exist: $path");
		}
	}
public function setBasePath($path)
	{
		$path = Yii::getAlias($path);
		$p = realpath($path);
		if ($p !== false && is_dir($p)) {
			$this->_basePath = $p;
		} else {
			throw new InvalidParamException("The directory does not exist: $path");
		}
	}
Sets the root directory of the application.
NOTE: This method can only be invoked at the beginning of the constructor.
@param string $path the root directory of the module. This can be either a directory name or a path alias.
@throws InvalidParamException if the directory does not exist.