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
This commit is contained in:
Helgi Þormar Þorbjörnsson 2007-08-16 00:42:22 +00:00
parent c810d23f97
commit c903d67a50
3 changed files with 23 additions and 41 deletions

View File

@ -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;
}
}
?>

View File

@ -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
*

View File

@ -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.