private function getPath($key, $isRealpath = FALSE)
{
$key = ltrim($key, ' /');
if (preg_match('#\\.\\.(/|$)#', $key)) {
throw new \InvalidArgumentException($key, self::ERROR_KEY_INVALID);
}
$rootpath = "{$this->root}/{$key}";
// check if is realpath
if ($isRealpath) {
$realpath = realpath($rootpath);
if (!$realpath) {
return FALSE;
}
return $realpath;
}
return $rootpath;
}