where is back compatibility?

May 20, 2010 at 1:11 PM

1.7.2 vs 1.7.3 => this is not major update. Where is back compatibility?

I understand, new function writer->save(), wich can use now file handler - is great, but why need to drop old posibility call it without parameters? Where is warnings about it in changelog?

Coordinator
May 20, 2010 at 2:29 PM

What specific writer are you targeting? This has not been chainged and the old methods should still work.

May 20, 2010 at 3:12 PM

 

$objPHPExcel = new PHPExcel();
// ...
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save();

 

 

Coordinator
May 20, 2010 at 4:44 PM

This should work as expected?

May 21, 2010 at 7:25 PM

 old OLE_Root.php / save() [line:102]

if ($filename == '-' || $filename == '') {
	$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
	$this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
	if ($this->_FILEH_ == false) {
		throw new Exception("Can't create temporary file.");
	}
} else {
	$this->_FILEH_ = fopen($filename, "wb");
	if ($this->_FILEH_ == false) {
		throw new Exception("Can't open $filename. It may be in use or protected.");
	}
}

 new Root.php / save() [line:70]

if (is_resource($filename)) {
	$this->_FILEH_ = $filename;
} else {
	$this->_FILEH_ = fopen($filename, "wb");
}
if ($this->_FILEH_ == false) {
	throw new Exception("Can't open $filename. It may be in use or protected.");
}

in result:
 v1.7.2 if empty params => use temp file
 v1.7.3 if empty params => Exception("Can't open $filename. It may be in use or protected.");

is it back compatibility?


Coordinator
May 25, 2010 at 6:22 AM

Has been fixed in the latest source code release.