diff --git a/SpreadsheetReader_XLSX.php b/SpreadsheetReader_XLSX.php index 9cf8d12..a17934c 100644 --- a/SpreadsheetReader_XLSX.php +++ b/SpreadsheetReader_XLSX.php @@ -321,19 +321,6 @@ public function __construct($Filepath, array $Options = null) */ public function __destruct() { - foreach ($this -> TempFiles as $TempFile) - { - @unlink($TempFile); - } - - // Better safe than sorry - shouldn't try deleting '.' or '/', or '..'. - if (strlen($this -> TempDir) > 2) - { - @rmdir($this -> TempDir.'xl'.DIRECTORY_SEPARATOR.'worksheets'); - @rmdir($this -> TempDir.'xl'); - @rmdir($this -> TempDir); - } - if ($this -> Worksheet && $this -> Worksheet instanceof XMLReader) { $this -> Worksheet -> close(); @@ -356,6 +343,19 @@ public function __destruct() { unset($this -> WorkbookXML); } + + foreach ($this -> TempFiles as $TempFile) + { + @unlink($TempFile); + } + + // Better safe than sorry - shouldn't try deleting '.' or '/', or '..'. + if (strlen($this -> TempDir) > 2) + { + @rmdir($this -> TempDir.'xl'.DIRECTORY_SEPARATOR.'worksheets'); + @rmdir($this -> TempDir.'xl'); + @rmdir($this -> TempDir); + } } /** diff --git a/composer.json b/composer.json index 0e64a78..a692086 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "nuovo/spreadsheet-reader", + "name": "pa-m/spreadsheet-reader", "description": "Spreadsheet reader library for Excel, OpenOffice and structured text files", "keywords": ["spreadsheet", "xls", "xlsx", "ods", "csv", "excel", "openoffice"], "homepage": "https://github.com/nuovo/spreadsheet-reader",