mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 21:36:05 +03:00
Use PHPExcel_Shared_File::sys_get_temp_dir() for temporary files directory where not explicitly specified
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@83402 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
135c0185f5
commit
a083de817e
@ -34,7 +34,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
||||
* Directory for temporary files
|
||||
* @var string
|
||||
*/
|
||||
protected $_tmp_dir = '';
|
||||
protected $_tmp_dir = NULL;
|
||||
|
||||
/**
|
||||
* @param integer $time_1st A timestamp
|
||||
@ -79,6 +79,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
||||
if (is_resource($filename)) {
|
||||
$this->_FILEH_ = $filename;
|
||||
} else if ($filename == '-' || $filename == '') {
|
||||
if (is_null($this->_tmp_dir))
|
||||
$this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
|
||||
$this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
|
||||
if ($this->_FILEH_ == false) {
|
||||
|
@ -59,12 +59,14 @@ class PHPExcel_Shared_XMLWriter extends XMLWriter {
|
||||
* @param int $pTemporaryStorage Temporary storage location
|
||||
* @param string $pTemporaryStorageFolder Temporary storage folder
|
||||
*/
|
||||
public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './') {
|
||||
public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = NULL) {
|
||||
// Open temporary storage
|
||||
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
|
||||
$this->openMemory();
|
||||
} else {
|
||||
// Create temporary filename
|
||||
if (is_null($pTemporaryStorageFolder))
|
||||
$pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
$this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
|
||||
|
||||
// Open storage
|
||||
|
Loading…
Reference in New Issue
Block a user