public function publishTarFile($tarfile, $md5sum, $checkTimestamp = false)
{
if (isset($this->_published[$md5sum])) {
return $this->_published[$md5sum];
} else {
if (($fullpath = realpath($md5sum)) === false || !is_file($fullpath)) {
throw new TInvalidDataValueException('assetmanager_tarchecksum_invalid', $md5sum);
} else {
$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) {
if (@filemtime($dst . DIRECTORY_SEPARATOR . $fileName) < @filemtime($fullpath)) {
$this->copyFile($fullpath, $dst);
$this->deployTarFile($tarfile, $dst);
}
}
return $this->_published[$md5sum] = $this->_baseUrl . '/' . $dir;
}
}
}