Вывод ошибки если не открывается файл

This commit is contained in:
origami11 2017-10-02 14:16:49 +03:00
parent 13a3f1cac7
commit e46867b134

View file

@ -76,7 +76,9 @@ class Excel_Document {
function save($filename) function save($filename)
{ {
$doc = new XMLWriter(); $doc = new XMLWriter();
$doc->openURI($filename); if (!$doc->openURI($filename)) {
throw new Exception("unknown file " . $filename);
}
$doc->setIndent(false); $doc->setIndent(false);
$doc->startDocument('1.0','utf-8'); $doc->startDocument('1.0','utf-8');
$doc->startElement('Workbook'); $doc->startElement('Workbook');