mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
add function elFinderVolumeDriver::getTempFile($path = '')
/** * Get temporary filename. Tempfile will be removed when after script execution finishes or exit() is called. * When needing the unique file to a path, give $path to parameter. * * @param string $path for get unique file to a path * @return string|false * @author Naoki Sawada */
This commit is contained in:
@@ -257,17 +257,6 @@ class elFinderVolumeMySQL extends elFinderVolumeDriver {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return temporary file path for required file
|
||||
*
|
||||
* @param string $path file path
|
||||
* @return string
|
||||
* @author Dmitry (dio) Levashov
|
||||
**/
|
||||
protected function tmpname($path) {
|
||||
return $this->tmpPath.DIRECTORY_SEPARATOR.md5($path);
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* FS API */
|
||||
/*********************************************************************/
|
||||
@@ -578,7 +567,7 @@ class elFinderVolumeMySQL extends elFinderVolumeDriver {
|
||||
**/
|
||||
protected function _fopen($path, $mode='rb') {
|
||||
$fp = $this->tmbPath
|
||||
? @fopen($this->tmpname($path), 'w+')
|
||||
? @fopen($this->getTempFile($path), 'w+')
|
||||
: @tmpfile();
|
||||
|
||||
|
||||
@@ -606,7 +595,7 @@ class elFinderVolumeMySQL extends elFinderVolumeDriver {
|
||||
protected function _fclose($fp, $path='') {
|
||||
@fclose($fp);
|
||||
if ($path) {
|
||||
@unlink($this->tmpname($path));
|
||||
@unlink($this->getTempFile($path));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user