ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
05featuredemo.php
Go to the documentation of this file.
1<?php
29error_reporting(E_ALL);
30ini_set('display_errors', TRUE);
31ini_set('display_startup_errors', TRUE);
32
33define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34
35date_default_timezone_set('Europe/London');
36
37include "05featuredemo.inc.php";
38
40require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
41
42
43// Save Excel 2007 file
44echo date('H:i:s') , " Write to Excel2007 format" , EOL;
45$callStartTime = microtime(true);
46
48$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
49$callEndTime = microtime(true);
51
52echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
53echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
54// Echo memory usage
55echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
56
57
58// Save Excel 95 file
59echo date('H:i:s') , " Write to Excel5 format" , EOL;
60$callStartTime = microtime(true);
61
63$objWriter->save(str_replace('.php', '.xls', __FILE__));
64$callEndTime = microtime(true);
66
67echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
68echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
69// Echo memory usage
70echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
71
72
73// Echo memory peak usage
74echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
75
76// Echo done
77echo date('H:i:s') , " Done writing files" , EOL;
78echo 'Files have been created in ' , getcwd() , EOL;
$objPHPExcel
memory_get_peak_usage(true)/1024/1024)
const EOL
$callEndTime
$callTime
$callStartTime
memory_get_usage(true)/1024/1024)
$objWriter
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Definition: IOFactory.php:132