5ini_set(
'display_errors', TRUE);
6ini_set(
'display_startup_errors', TRUE);
7date_default_timezone_set(
'Europe/London');
9define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11date_default_timezone_set(
'Europe/London');
40set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43include
'PHPExcel/IOFactory.php';
48if ((isset($argc)) && ($argc > 1)) {
50 for($i = 1; $i < $argc; ++$i) {
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;
116 echo
date(
'H:i:s') ,
" Write Tests to Excel2007 file " ,
EOL;
120 echo
date(
'H:i:s') ,
" File written to " , $outputFileName ,
EOL;
130echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
131echo
'Files have been created in ' , getcwd() ,
EOL;
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
memory_get_peak_usage(true)/1024/1024)
$inputFileType
PHPExcel_IOFactory.
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.