From c903d67a50c131165eaa059b4300d0c358f11651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helgi=20=C3=9Eormar=20=C3=9Eorbj=C3=B6rnsson?= Date: Thu, 16 Aug 2007 00:42:22 +0000 Subject: [PATCH] Moving setTempDir to the BIFFWriter for now since Workbook and Worksheet both extend from that class git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@241288 c90b9560-bf6c-de11-be94-00142212c4b1 --- Spreadsheet/Excel/Writer/BIFFwriter.php | 23 +++++++++++++++++++++++ Spreadsheet/Excel/Writer/Workbook.php | 23 ----------------------- Spreadsheet/Excel/Writer/Worksheet.php | 18 ------------------ 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/Spreadsheet/Excel/Writer/BIFFwriter.php b/Spreadsheet/Excel/Writer/BIFFwriter.php index 64885f2..2e129f9 100644 --- a/Spreadsheet/Excel/Writer/BIFFwriter.php +++ b/Spreadsheet/Excel/Writer/BIFFwriter.php @@ -84,6 +84,12 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR */ var $_limit; + /** + * The temporary dir for storing the OLE file + * @var string + */ + var $_tmp_dir; + /** * Constructor * @@ -95,6 +101,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR $this->_data = ''; $this->_datasize = 0; $this->_limit = 2080; + $this->_tmp_dir = ''; // Set the byte order $this->_setByteOrder(); } @@ -234,5 +241,21 @@ class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR return $tmp; } + + /** + * Sets the temp dir used for storing the OLE file + * + * @access public + * @param string $dir The dir to be used as temp dir + * @return true if given dir is valid, false otherwise + */ + function setTempDir($dir) + { + if (is_dir($dir)) { + $this->_tmp_dir = $dir; + return true; + } + return false; + } } ?> diff --git a/Spreadsheet/Excel/Writer/Workbook.php b/Spreadsheet/Excel/Writer/Workbook.php index 9a6b0cd..e8ad440 100644 --- a/Spreadsheet/Excel/Writer/Workbook.php +++ b/Spreadsheet/Excel/Writer/Workbook.php @@ -159,12 +159,6 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri */ var $_country_code; - /** - * The temporary dir for storing the OLE file - * @var string - */ - var $_tmp_dir; - /** * number of bytes for sizeinfo of strings * @var integer @@ -207,7 +201,6 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri $this->_str_unique = 0; $this->_str_table = array(); $this->_setPaletteXl97(); - $this->_tmp_dir = ''; } /** @@ -563,22 +556,6 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri return true; } - /** - * Sets the temp dir used for storing the OLE file - * - * @access public - * @param string $dir The dir to be used as temp dir - * @return true if given dir is valid, false otherwise - */ - function setTempDir($dir) - { - if (is_dir($dir)) { - $this->_tmp_dir = $dir; - return true; - } - return false; - } - /** * Store the workbook in an OLE container * diff --git a/Spreadsheet/Excel/Writer/Worksheet.php b/Spreadsheet/Excel/Writer/Worksheet.php index 5d6fe7e..561c03f 100644 --- a/Spreadsheet/Excel/Writer/Worksheet.php +++ b/Spreadsheet/Excel/Writer/Worksheet.php @@ -391,7 +391,6 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr //$this->ext_sheets = array(); $this->_filehandle = ''; $this->_using_tmpfile = true; - $this->_tmp_dir = ''; //$this->fileclosed = 0; //$this->offset = 0; $this->_xls_rowmax = $rowmax; @@ -501,23 +500,6 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr } } - /** - * Sets the temp dir used for storing the Excel file - * - * @access public - * @param string $dir The dir to be used as temp dir - * @return true if given dir is valid, false otherwise - */ - function setTempDir($dir) - { - if (is_dir($dir)) { - $this->_tmp_dir = $dir; - return true; - } - - return false; - } - /** * Add data to the beginning of the workbook (note the reverse order) * and to the end of the workbook.