You are here

public function PHPExcel_Shared_XMLWriter::__construct in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/XMLWriter.php \PHPExcel_Shared_XMLWriter::__construct()

* Create a new PHPExcel_Shared_XMLWriter instance * *

Parameters

int $pTemporaryStorage Temporary storage location: * @param string $pTemporaryStorageFolder Temporary storage folder

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/XMLWriter.php, line 62

Class

PHPExcel_Shared_XMLWriter
PHPExcel_Shared_XMLWriter

Code

public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = NULL) {

  // Open temporary storage
  if ($pTemporaryStorage == self::STORAGE_MEMORY) {
    $this
      ->openMemory();
  }
  else {

    // Create temporary filename
    if ($pTemporaryStorageFolder === NULL) {
      $pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir();
    }
    $this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');

    // Open storage
    if ($this
      ->openUri($this->_tempFileName) === false) {

      // Fallback to memory...
      $this
        ->openMemory();
    }
  }

  // Set default values
  if (DEBUGMODE_ENABLED) {
    $this
      ->setIndent(true);
  }
}