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:
nao-pon
2015-01-25 11:18:15 +09:00
parent ffd0dcc7e1
commit 6d65f8da5c
5 changed files with 59 additions and 57 deletions
+2 -13
View File
@@ -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));
}
}