public function publishFilePath($path, $checkTimestamp = false)
{
if (isset($this->_published[$path])) {
return $this->_published[$path];
} else {
if (empty($path) || ($fullpath = realpath($path)) === false) {
throw new TInvalidDataValueException('assetmanager_filepath_invalid', $path);
} else {
if (is_file($fullpath)) {
$dir = $this->hash(dirname($fullpath));
$fileName = basename($fullpath);
$dst = $this->_basePath . DIRECTORY_SEPARATOR . $dir;
if (!is_file($dst . DIRECTORY_SEPARATOR . $fileName) || $checkTimestamp || $this->getApplication()->getMode() !== TApplicationMode::Performance) {
$this->copyFile($fullpath, $dst);
}
return $this->_published[$path] = $this->_baseUrl . '/' . $dir . '/' . $fileName;
} else {
$dir = $this->hash($fullpath);
if (!is_dir($this->_basePath . DIRECTORY_SEPARATOR . $dir) || $checkTimestamp || $this->getApplication()->getMode() !== TApplicationMode::Performance) {
Prado::trace("Publishing directory {$fullpath}", 'Prado\\Web\\TAssetManager');
$this->copyDirectory($fullpath, $this->_basePath . DIRECTORY_SEPARATOR . $dir);
}
return $this->_published[$path] = $this->_baseUrl . '/' . $dir;
}
}
}
}