ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
27imagesexcel5.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 
38 require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
39 
40 
41 // Read from Excel5 (.xls) template
42 echo date('H:i:s') , " Load Excel2007 template file" , EOL;
44 $objPHPExcel = $objReader->load("templates/27template.xls");
45 
46 // Export to Excel2007 (.xlsx)
47 echo date('H:i:s') , " Write to Excel5 format" , EOL;
49 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
50 echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
51 
52 // Export to Excel5 (.xls)
53 echo date('H:i:s') , " Write to Excel5 format" , EOL;
55 $objWriter->save(str_replace('.php', '.xls', __FILE__));
56 echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
57 
58 
59 // Echo memory peak usage
60 echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
61 
62 // Echo done
63 echo date('H:i:s') , " Done writing files" , EOL;
64 echo 'Files have been created in ' , getcwd() , EOL;
$objPHPExcel
$objReader
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
Definition: IOFactory.php:161
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
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$objWriter
const EOL