ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
05featuredemo.php
Go to the documentation of this file.
1 <?php
29 error_reporting(E_ALL);
30 ini_set('display_errors', TRUE);
31 ini_set('display_startup_errors', TRUE);
32 
33 define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 
35 date_default_timezone_set('Europe/London');
36 
37 include "05featuredemo.inc.php";
38 
40 require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
41 
42 
43 // Save Excel 2007 file
44 echo 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 
52 echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
53 echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
54 // Echo memory usage
55 echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
56 
57 
58 // Save Excel 95 file
59 echo 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 
67 echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
68 echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
69 // Echo memory usage
70 echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
71 
72 
73 // Echo memory peak usage
74 echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
75 
76 // Echo done
77 echo date('H:i:s') , " Done writing files" , EOL;
78 echo 'Files have been created in ' , getcwd() , EOL;
$callStartTime
$objPHPExcel
$callEndTime
$objWriter
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
Definition: IOFactory.php:132
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
const EOL
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$callTime