ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
OOCalcReaderPCLZip.php
Go to the documentation of this file.
1<?php
29error_reporting(E_ALL);
30
31date_default_timezone_set('Europe/London');
32
34require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
35
36// Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file
38
39echo date('H:i:s') , " Load from OOCalc file" , PHP_EOL;
40$callStartTime = microtime(true);
41
43$objPHPExcel = $objReader->load("OOCalcTest.ods");
44
45
46$callEndTime = microtime(true);
48echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , PHP_EOL;
49// Echo memory usage
50echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
51
52
53echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL;
55$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
56echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;
57
58
59// Echo memory peak usage
60echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
61
62// Echo done
63echo date('H:i:s') , " Done writing file" , PHP_EOL;
64
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
memory_get_peak_usage(true)/1024/1024)
$callStartTime
memory_get_usage(true)/1024/1024)
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Definition: IOFactory.php:132
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
Definition: IOFactory.php:161
const PCLZIP
constants
Definition: Settings.php:42
static setZipClass($zipClass)
Set the Zip handler Class that PHPExcel should use for Zip file management (PCLZip or ZipArchive)
Definition: Settings.php:122