Skip to content

Instantly share code, notes, and snippets.

@radzserg
Created January 3, 2014 11:10
Show Gist options
  • Save radzserg/8236307 to your computer and use it in GitHub Desktop.
Save radzserg/8236307 to your computer and use it in GitHub Desktop.
init function
public function init()
{
parent::init();
$this->basePath = Yii::getAlias($this->basePath);
if (!is_dir($this->basePath)) {
throw new InvalidConfigException("The directory does not exist: {$this->basePath}");
} elseif (!is_writable($this->basePath)) {
throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}");
} else {
$this->basePath = realpath($this->basePath);
}
$this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment