/** * Gets the directory relative to DOC_ROOT * @param string $dirname * @return string * @throws Exception */ protected function getDir($dirname = '') { $dir = realpath($this->settings->getDocRoot() . (!empty($dirname) ? $dirname : '')); if (substr($dir, 0, -1) != '/') { $dir .= '/'; } if (!$dir) { throw new Exception('Directory "' . $dir . '" not found.'); } return $dir; }