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
|
* Directory for temporary files
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $_tmp_dir = '';
|
protected $_tmp_dir = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer $time_1st A timestamp
|
* @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)) {
|
if (is_resource($filename)) {
|
||||||
$this->_FILEH_ = $filename;
|
$this->_FILEH_ = $filename;
|
||||||
} else if ($filename == '-' || $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->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
|
||||||
$this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
|
$this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
|
||||||
if ($this->_FILEH_ == false) {
|
if ($this->_FILEH_ == false) {
|
||||||
|
@ -59,12 +59,14 @@ class PHPExcel_Shared_XMLWriter extends XMLWriter {
|
|||||||
* @param int $pTemporaryStorage Temporary storage location
|
* @param int $pTemporaryStorage Temporary storage location
|
||||||
* @param string $pTemporaryStorageFolder Temporary storage folder
|
* @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
|
// Open temporary storage
|
||||||
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
|
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
|
||||||
$this->openMemory();
|
$this->openMemory();
|
||||||
} else {
|
} else {
|
||||||
// Create temporary filename
|
// Create temporary filename
|
||||||
|
if (is_null($pTemporaryStorageFolder))
|
||||||
|
$pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||||
$this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
|
$this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
|
||||||
|
|
||||||
// Open storage
|
// Open storage
|
||||||
|
Loading…
Reference in New Issue
Block a user