4 error_reporting(E_ALL);
5 ini_set(
'display_errors', TRUE);
6 ini_set(
'display_startup_errors', TRUE);
7 date_default_timezone_set(
'Europe/London');
9 define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11 date_default_timezone_set(
'Europe/London');
40 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43 include
'PHPExcel/IOFactory.php';
48 if ((isset($argc)) && ($argc > 1)) {
50 for(
$i = 1;
$i < $argc; ++
$i) {
57 $inputFileNameShort = basename($inputFileName);
59 if (!file_exists($inputFileName)) {
60 echo
date(
'H:i:s') ,
" File " , $inputFileNameShort ,
' does not exist' ,
EOL;
64 echo
date(
'H:i:s') ,
" Load Test from $inputFileType file " , $inputFileNameShort ,
EOL;
71 echo
date(
'H:i:s') ,
" Iterate worksheets looking at the charts" ,
EOL;
74 echo
'Worksheet: ' , $sheetName ,
EOL;
77 if(empty($chartNames)) {
78 echo
' There are no charts in this worksheet' ,
EOL;
81 foreach($chartNames as
$i => $chartName) {
83 if (!is_null(
$chart->getTitle())) {
84 $caption =
'"' . implode(
' ',
$chart->getTitle()->getCaption()) .
'"';
86 $caption =
'Untitled';
88 echo
' ' , $chartName ,
' - ' , $caption ,
EOL;
89 echo str_repeat(
' ',strlen($chartName)+3);
90 $groupCount =
$chart->getPlotArea()->getPlotGroupCount();
91 if ($groupCount == 1) {
92 $chartType =
$chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
93 echo
' ' , $chartType ,
EOL;
95 $chartTypes =
array();
96 for(
$i = 0;
$i < $groupCount; ++
$i) {
97 $chartTypes[] =
$chart->getPlotArea()->getPlotGroupByIndex(
$i)->getPlotType();
99 $chartTypes = array_unique($chartTypes);
100 if (count($chartTypes) == 1) {
101 $chartType =
'Multiple Plot ' . array_pop($chartTypes);
102 echo
' ' , $chartType ,
EOL;
103 } elseif (count($chartTypes) == 0) {
104 echo
' *** Type not yet implemented' ,
EOL;
106 echo
' Combination Chart' ,
EOL;
114 $outputFileName = basename($inputFileName);
116 echo
date(
'H:i:s') ,
" Write Tests to Excel2007 file " ,
EOL;
120 echo
date(
'H:i:s') ,
" File written to " , $outputFileName ,
EOL;
127 echo
date(
'H:i:s') ,
' Peak memory usage: ' , (memory_get_peak_usage(
true) / 1024 / 1024) ,
" MB" ,
EOL;
130 echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
131 echo
'Files have been created in ' , getcwd() ,
EOL;
$inputFileType
PHPExcel_IOFactory.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
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())
Create styles array
The data for the language used.