public getPublishedPath ( string $path ) : string | false | ||
$path | string | directory or file path being published |
return | string | false | string the published file path. False if the file or directory does not exist |
public function getPublishedPath($path)
{
$path = Yii::getAlias($path);
if (isset($this->_published[$path])) {
return $this->_published[$path][0];
}
if (is_string($path) && ($path = realpath($path)) !== false) {
return $this->basePath . DIRECTORY_SEPARATOR . $this->hash($path) . (is_file($path) ? DIRECTORY_SEPARATOR . basename($path) : '');
} else {
return false;
}
}