Re: [patch] Spreadsheet_Excel_Writer open_basedir workaround fix
| From: | Helgi Þormar Þorbjörnsson | Date: | Tue, 02 Sep 2008 12:15:00 +0000 |
| Subject: | Re: [patch] Spreadsheet_Excel_Writer open_basedir workaround fix | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50703@lists.php.net to get a copy of this message | ||
Hi,
On Mon, Sep 1, 2008 at 12:19 AM, Sandro Berg <Sandro_Berg@gmx.de> wrote:
> Hello,
>
> I ran into a problem using Spreadsheet_Excel_Writer on a server with
> open_basedir restriction. In the current CVS version the _tmp_dir set by
> setTempDir() won't get propagated from the workbook to the worksheets,
> so Spreadsheet_Excel_Writer_Worksheet::_initialize() will try to use
> tmpfile() and fail - writing the Warning into the generated Excel file.
>
> The appended patch will:
> - add a parameter $tmp_dir to the constructor of
> Spreadsheet_Excel_Writer_Worksheet
>
> - make the Spreadsheet_Excel_Writer_Workbook::addWorksheet() factory
> pass the value of $this->_tmp_dir to the
> Spreadsheet_Excel_Writer_Worksheet constructor
>
> As Spreadsheet_Excel_Writer_Worksheet::_initialize() is called directly
> from the contructor, this cannot be set later.
> Spreadsheet_Excel_Writer_Worksheet is private, so the public API does
> not change.
>
> I do not claim copyright for this small fix, use as you see fit.
> Feedback appreciated.
Please open a report and attach this fix at
pear.php.net/spreadsheet_excel_writer
- Helgi