* Output file headers to initialise the download of the file.
*/
public function send_http_headers() {
- $this->writer = \Box\Spout\Writer\WriterFactory::create($this->spouttype);
+ $this->writer = \Box\Spout\Writer\Common\Creator\WriterEntityFactory::createWriter($this->spouttype);
if (method_exists($this->writer, 'setTempFolder')) {
$this->writer->setTempFolder(make_request_directory());
}
* @param array $columns
*/
public function start_sheet($columns) {
- if ($this->sheettitle && $this->writer instanceof \Box\Spout\Writer\AbstractMultiSheetsWriter) {
+ if ($this->sheettitle && $this->writer instanceof \Box\Spout\Writer\WriterMultiSheetsAbstract) {
if ($this->renamecurrentsheet) {
$sheet = $this->writer->getCurrentSheet();
$this->renamecurrentsheet = false;
}
$sheet->setName($this->sheettitle);
}
- $this->writer->addRow(array_values((array)$columns));
+ $row = \Box\Spout\Writer\Common\Creator\WriterEntityFactory::createRowFromArray((array)$columns);
+ $this->writer->addRow($row);
}
/**
* @param int $rownum
*/
public function write_record($record, $rownum) {
- $this->writer->addRow(array_values((array)$record));
+ $row = \Box\Spout\Writer\Common\Creator\WriterEntityFactory::createRowFromArray((array)$record);
+ $this->writer->addRow($row);
}
/**
-Description of Spout library import 2.7.3
+Description of Spout library import 3.0.1
=========================================
* Download / Clone from https://github.com/box/spout/
* Only include the src/Spout directory.
* Update lib/thirdpartylibs.xml with the latest version.
+2019/06/17
+----------
+Update to v3.0.1 (MDL-65762)
+by Adrian Greeve <adrian@moodle.com>
+
2017/10/10
----------
Updated to v2.7.3 (MDL-60288)
<location>spout</location>
<name>Spout</name>
<license>Apache</license>
- <version>2.7.3</version>
+ <version>3.0.1</version>
<licenseversion>2.0</licenseversion>
</library>
<library>