Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400]
1 <?php 2 3 namespace PhpOffice\PhpSpreadsheet\Writer\Ods; 4 5 use PhpOffice\PhpSpreadsheet\Shared\XMLWriter; 6 7 class MetaInf extends WriterPart 8 { 9 /** 10 * Write META-INF/manifest.xml to XML format. 11 * 12 * @return string XML Output 13 */ 14 public function write(): string 15 { 16 $objWriter = null; 17 if ($this->getParentWriter()->getUseDiskCaching()) { 18 $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); 19 } else { 20 $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY); 21 } 22 23 // XML header 24 $objWriter->startDocument('1.0', 'UTF-8'); 25 26 // Manifest 27 $objWriter->startElement('manifest:manifest'); 28 $objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0'); 29 $objWriter->writeAttribute('manifest:version', '1.2'); 30 31 $objWriter->startElement('manifest:file-entry'); 32 $objWriter->writeAttribute('manifest:full-path', '/'); 33 $objWriter->writeAttribute('manifest:version', '1.2'); 34 $objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet'); 35 $objWriter->endElement(); 36 $objWriter->startElement('manifest:file-entry'); 37 $objWriter->writeAttribute('manifest:full-path', 'meta.xml'); 38 $objWriter->writeAttribute('manifest:media-type', 'text/xml'); 39 $objWriter->endElement(); 40 $objWriter->startElement('manifest:file-entry'); 41 $objWriter->writeAttribute('manifest:full-path', 'settings.xml'); 42 $objWriter->writeAttribute('manifest:media-type', 'text/xml'); 43 $objWriter->endElement(); 44 $objWriter->startElement('manifest:file-entry'); 45 $objWriter->writeAttribute('manifest:full-path', 'content.xml'); 46 $objWriter->writeAttribute('manifest:media-type', 'text/xml'); 47 $objWriter->endElement(); 48 $objWriter->startElement('manifest:file-entry'); 49 $objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png'); 50 $objWriter->writeAttribute('manifest:media-type', 'image/png'); 51 $objWriter->endElement(); 52 $objWriter->startElement('manifest:file-entry'); 53 $objWriter->writeAttribute('manifest:full-path', 'styles.xml'); 54 $objWriter->writeAttribute('manifest:media-type', 'text/xml'); 55 $objWriter->endElement(); 56 $objWriter->endElement(); 57 58 return $objWriter->getData(); 59 } 60 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body