public string
_getFilename
(mixed $filename, mixed $mode, mixed $usePrefix, mixed $relative)
/**
* Determine the appropriate 'filename' of a file
*
* @param string $filename Original filename of the file
* @param string $mode Mode string to retrieve the filename
* @param boolean $usePrefix Controls the use of a prefix
* @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped.
*
* @return string
*
* @since 1.7.0
*/
public function _getFilename($filename, $mode, $usePrefix, $relative)
{
if ($usePrefix) {
// Get rid of binary or t, should be at the end of the string
$tmode = trim($mode, 'btf123456789');
// Check if it's a write mode then add the appropriate prefix
// Get rid of JPATH_ROOT (legacy compat) along the way
if (\in_array($tmode, FilesystemHelper::getWriteModes())) {
if (!$relative && $this->writeprefix) {
$filename = str_replace(JPATH_ROOT, '', $filename);
}
$filename = $this->writeprefix . $filename;
} else {
if (!$relative && $this->readprefix) {
$filename = str_replace(JPATH_ROOT, '', $filename);
}
$filename = $this->readprefix . $filename;
}
}
return $filename;
}