@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ini_set('display_startup_errors', TRUE); |
32 | 32 | date_default_timezone_set('Europe/London'); |
33 | 33 | |
34 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
34 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
35 | 35 | |
36 | 36 | date_default_timezone_set('Europe/London'); |
37 | 37 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | require_once dirname(__FILE__) . '/../src/Bootstrap.php'; |
42 | 42 | |
43 | 43 | |
44 | -echo date('H:i:s') , " Write to HTML format" , EOL; |
|
44 | +echo date('H:i:s'), " Write to HTML format", EOL; |
|
45 | 45 | $callStartTime = microtime(true); |
46 | 46 | |
47 | 47 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'HTML'); |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | $objWriter->save(str_replace('.php', '.htm', __FILE__)); |
51 | 51 | $callEndTime = microtime(true); |
52 | 52 | $callTime = $callEndTime - $callStartTime; |
53 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.htm', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
54 | -echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL; |
|
53 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.htm', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
54 | +echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL; |
|
55 | 55 | // Echo memory usage |
56 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
56 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL; |
|
57 | 57 | |
58 | 58 | |
59 | 59 | // Echo memory peak usage |
60 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
60 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; |
|
61 | 61 | |
62 | 62 | // Echo done |
63 | -echo date('H:i:s') , " Done writing file" , EOL; |
|
64 | -echo 'File has been created in ' , getcwd() , EOL; |
|
63 | +echo date('H:i:s'), " Done writing file", EOL; |
|
64 | +echo 'File has been created in ', getcwd(), EOL; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ini_set('display_startup_errors', TRUE); |
32 | 32 | date_default_timezone_set('Europe/London'); |
33 | 33 | |
34 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
34 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
35 | 35 | |
36 | 36 | date_default_timezone_set('Europe/London'); |
37 | 37 | |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | // Create new PHPExcel object |
43 | -echo date('H:i:s') , " Create new PHPExcel object" , EOL; |
|
43 | +echo date('H:i:s'), " Create new PHPExcel object", EOL; |
|
44 | 44 | $objPHPExcel = new \PHPExcel\Spreadsheet(); |
45 | 45 | |
46 | 46 | // Add some data, we will use some formulas here |
47 | -echo date('H:i:s') , " Add some data and formulas" , EOL; |
|
47 | +echo date('H:i:s'), " Add some data and formulas", EOL; |
|
48 | 48 | $objPHPExcel->getActiveSheet()->setCellValue('A1', '=B1') |
49 | 49 | ->setCellValue('A2', '=B2+1') |
50 | 50 | ->setCellValue('B1', '=A1+1') |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | \PHPExcel\Calculation::getInstance($objPHPExcel)->cyclicFormulaCount = 100; |
54 | 54 | |
55 | 55 | // Calculated data |
56 | -echo date('H:i:s') , " Calculated data" , EOL; |
|
57 | -for($row = 1; $row <= 2; ++$row) { |
|
56 | +echo date('H:i:s'), " Calculated data", EOL; |
|
57 | +for ($row = 1; $row <= 2; ++$row) { |
|
58 | 58 | for ($col = 'A'; $col != 'C'; ++$col) { |
59 | - if ((!is_null($formula = $objPHPExcel->getActiveSheet()->getCell($col.$row)->getValue())) && |
|
59 | + if ((!is_null($formula = $objPHPExcel->getActiveSheet()->getCell($col . $row)->getValue())) && |
|
60 | 60 | ($formula[0] == '=')) { |
61 | - echo 'Value of ' , $col , $row , ' [' , $formula , ']: ' , |
|
62 | - $objPHPExcel->getActiveSheet()->getCell($col.$row)->getCalculatedValue() . EOL; |
|
61 | + echo 'Value of ', $col, $row, ' [', $formula, ']: ', |
|
62 | + $objPHPExcel->getActiveSheet()->getCell($col . $row)->getCalculatedValue() . EOL; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | 68 | // Save Excel 2007 file |
69 | -echo date('H:i:s') , " Write to Excel2007 format" , EOL; |
|
69 | +echo date('H:i:s'), " Write to Excel2007 format", EOL; |
|
70 | 70 | $callStartTime = microtime(true); |
71 | 71 | |
72 | 72 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007'); |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | $callEndTime = microtime(true); |
84 | 84 | $callTime = $callEndTime - $callStartTime; |
85 | 85 | |
86 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
87 | -echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL; |
|
86 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
87 | +echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL; |
|
88 | 88 | // Echo memory usage |
89 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
89 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL; |
|
90 | 90 | |
91 | 91 | |
92 | 92 | // Echo memory peak usage |
93 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
93 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; |
|
94 | 94 | |
95 | 95 | // Echo done |
96 | -echo date('H:i:s') , " Done writing file" , EOL; |
|
97 | -echo 'File has been created in ' , getcwd() , EOL; |
|
96 | +echo date('H:i:s'), " Done writing file", EOL; |
|
97 | +echo 'File has been created in ', getcwd(), EOL; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ini_set('display_startup_errors', TRUE); |
32 | 32 | date_default_timezone_set('Europe/London'); |
33 | 33 | |
34 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
34 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
35 | 35 | |
36 | 36 | date_default_timezone_set('Europe/London'); |
37 | 37 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | // Create new PHPExcel object |
43 | -echo date('H:i:s') , " Create new PHPExcel object" , EOL; |
|
43 | +echo date('H:i:s'), " Create new PHPExcel object", EOL; |
|
44 | 44 | $objPHPExcel = new \PHPExcel\Spreadsheet(); |
45 | 45 | |
46 | 46 | |
47 | 47 | // Set document properties |
48 | -echo date('H:i:s') , " Set document properties" , EOL; |
|
48 | +echo date('H:i:s'), " Set document properties", EOL; |
|
49 | 49 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
50 | 50 | ->setLastModifiedBy("Maarten Balliauw") |
51 | 51 | ->setTitle("Office 2007 XLSX Test Document") |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | |
58 | 58 | // Create a first sheet |
59 | -echo date('H:i:s') , " Add data" , EOL; |
|
59 | +echo date('H:i:s'), " Add data", EOL; |
|
60 | 60 | $objPHPExcel->setActiveSheetIndex(0); |
61 | 61 | $objPHPExcel->getActiveSheet()->setCellValue('A1', "Cell B3 and B5 contain data validation...") |
62 | 62 | ->setCellValue('A3', "Number:") |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | |
75 | 75 | |
76 | 76 | // Set data validation |
77 | -echo date('H:i:s') , " Set data validation" , EOL; |
|
77 | +echo date('H:i:s'), " Set data validation", EOL; |
|
78 | 78 | $objValidation = $objPHPExcel->getActiveSheet()->getCell('B3')->getDataValidation(); |
79 | -$objValidation->setType( \PHPExcel\Cell\DataValidation::TYPE_WHOLE ); |
|
80 | -$objValidation->setErrorStyle( \PHPExcel\Cell\DataValidation::STYLE_STOP ); |
|
79 | +$objValidation->setType(\PHPExcel\Cell\DataValidation::TYPE_WHOLE); |
|
80 | +$objValidation->setErrorStyle(\PHPExcel\Cell\DataValidation::STYLE_STOP); |
|
81 | 81 | $objValidation->setAllowBlank(true); |
82 | 82 | $objValidation->setShowInputMessage(true); |
83 | 83 | $objValidation->setShowErrorMessage(true); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $objValidation->setFormula2(20); |
90 | 90 | |
91 | 91 | $objValidation = $objPHPExcel->getActiveSheet()->getCell('B5')->getDataValidation(); |
92 | -$objValidation->setType( \PHPExcel\Cell\DataValidation::TYPE_LIST ); |
|
93 | -$objValidation->setErrorStyle( \PHPExcel\Cell\DataValidation::STYLE_INFORMATION ); |
|
92 | +$objValidation->setType(\PHPExcel\Cell\DataValidation::TYPE_LIST); |
|
93 | +$objValidation->setErrorStyle(\PHPExcel\Cell\DataValidation::STYLE_INFORMATION); |
|
94 | 94 | $objValidation->setAllowBlank(false); |
95 | 95 | $objValidation->setShowInputMessage(true); |
96 | 96 | $objValidation->setShowErrorMessage(true); |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | $objValidation->setError('Value is not in list.'); |
100 | 100 | $objValidation->setPromptTitle('Pick from list'); |
101 | 101 | $objValidation->setPrompt('Please pick a value from the drop-down list.'); |
102 | -$objValidation->setFormula1('"Item A,Item B,Item C"'); // Make sure to put the list items between " and " !!! |
|
102 | +$objValidation->setFormula1('"Item A,Item B,Item C"'); // Make sure to put the list items between " and " !!! |
|
103 | 103 | |
104 | 104 | $objValidation = $objPHPExcel->getActiveSheet()->getCell('B7')->getDataValidation(); |
105 | -$objValidation->setType( \PHPExcel\Cell\DataValidation::TYPE_LIST ); |
|
106 | -$objValidation->setErrorStyle( \PHPExcel\Cell\DataValidation::STYLE_INFORMATION ); |
|
105 | +$objValidation->setType(\PHPExcel\Cell\DataValidation::TYPE_LIST); |
|
106 | +$objValidation->setErrorStyle(\PHPExcel\Cell\DataValidation::STYLE_INFORMATION); |
|
107 | 107 | $objValidation->setAllowBlank(false); |
108 | 108 | $objValidation->setShowInputMessage(true); |
109 | 109 | $objValidation->setShowErrorMessage(true); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $objValidation->setError('Value is not in list.'); |
113 | 113 | $objValidation->setPromptTitle('Pick from list'); |
114 | 114 | $objValidation->setPrompt('Please pick a value from the drop-down list.'); |
115 | -$objValidation->setFormula1('$D$2:$D$6'); // Make sure NOT to put a range of cells or a formula between " and " !!! |
|
115 | +$objValidation->setFormula1('$D$2:$D$6'); // Make sure NOT to put a range of cells or a formula between " and " !!! |
|
116 | 116 | |
117 | 117 | |
118 | 118 | // Set active sheet index to the first sheet, so Excel opens this as the first sheet |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | |
122 | 122 | // Save Excel 95 file |
123 | -echo date('H:i:s') , " Write to Excel5 format" , EOL; |
|
123 | +echo date('H:i:s'), " Write to Excel5 format", EOL; |
|
124 | 124 | $callStartTime = microtime(true); |
125 | 125 | |
126 | 126 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5'); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | $callEndTime = microtime(true); |
129 | 129 | $callTime = $callEndTime - $callStartTime; |
130 | 130 | |
131 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
132 | -echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL; |
|
131 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
132 | +echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL; |
|
133 | 133 | // Echo memory usage |
134 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
134 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL; |
|
135 | 135 | |
136 | 136 | |
137 | 137 | // Echo memory peak usage |
138 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
138 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; |
|
139 | 139 | |
140 | 140 | // Echo done |
141 | -echo date('H:i:s') , " Done writing file" , EOL; |
|
142 | -echo 'File has been created in ' , getcwd() , EOL; |
|
141 | +echo date('H:i:s'), " Done writing file", EOL; |
|
142 | +echo 'File has been created in ', getcwd(), EOL; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php'; |
35 | 35 | |
36 | 36 | |
37 | -echo date('H:i:s') , " Load from Excel2003XML file" , PHP_EOL; |
|
37 | +echo date('H:i:s'), " Load from Excel2003XML file", PHP_EOL; |
|
38 | 38 | $callStartTime = microtime(true); |
39 | 39 | |
40 | 40 | $objReader = \PHPExcel\IOFactory::createReader('Excel2003XML'); |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | |
44 | 44 | $callEndTime = microtime(true); |
45 | 45 | $callTime = $callEndTime - $callStartTime; |
46 | -echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , PHP_EOL; |
|
46 | +echo 'Call time to read Workbook was ', sprintf('%.4f', $callTime), " seconds", PHP_EOL; |
|
47 | 47 | // Echo memory usage |
48 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; |
|
48 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", PHP_EOL; |
|
49 | 49 | |
50 | 50 | |
51 | -echo date('H:i:s') , " Write to Excel5 format" , PHP_EOL; |
|
51 | +echo date('H:i:s'), " Write to Excel5 format", PHP_EOL; |
|
52 | 52 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5'); |
53 | 53 | $objWriter->save(str_replace('.php', '.xls', __FILE__)); |
54 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', __FILE__) , PHP_EOL; |
|
54 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', __FILE__), PHP_EOL; |
|
55 | 55 | |
56 | 56 | |
57 | 57 | // Echo memory peak usage |
58 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; |
|
58 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", PHP_EOL; |
|
59 | 59 | |
60 | 60 | // Echo done |
61 | -echo date('H:i:s') , " Done writing file" , PHP_EOL; |
|
61 | +echo date('H:i:s'), " Done writing file", PHP_EOL; |
@@ -114,11 +114,11 @@ |
||
114 | 114 | |
115 | 115 | // First, clear all previous run results |
116 | 116 | foreach ($aTests as $sTest) { |
117 | - @unlink( str_replace('.php', '.xls', $sTest) ); |
|
118 | - @unlink( str_replace('.php', '.xlsx', $sTest) ); |
|
119 | - @unlink( str_replace('.php', '.csv', $sTest) ); |
|
120 | - @unlink( str_replace('.php', '.htm', $sTest) ); |
|
121 | - @unlink( str_replace('.php', '.pdf', $sTest) ); |
|
117 | + @unlink(str_replace('.php', '.xls', $sTest)); |
|
118 | + @unlink(str_replace('.php', '.xlsx', $sTest)); |
|
119 | + @unlink(str_replace('.php', '.csv', $sTest)); |
|
120 | + @unlink(str_replace('.php', '.htm', $sTest)); |
|
121 | + @unlink(str_replace('.php', '.pdf', $sTest)); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // Run all tests |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | ini_set('display_startup_errors', TRUE); |
7 | 7 | date_default_timezone_set('Europe/London'); |
8 | 8 | |
9 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
9 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
10 | 10 | |
11 | 11 | date_default_timezone_set('Europe/London'); |
12 | 12 | |
@@ -44,19 +44,19 @@ discard block |
||
44 | 44 | $objWorksheet = $objPHPExcel->getActiveSheet(); |
45 | 45 | $objWorksheet->fromArray( |
46 | 46 | array( |
47 | - array('', '', 'Budget', 'Forecast', 'Actual'), |
|
48 | - array('2010', 'Q1', 47, 44, 43 ), |
|
49 | - array('', 'Q2', 56, 53, 50 ), |
|
50 | - array('', 'Q3', 52, 46, 45 ), |
|
51 | - array('', 'Q4', 45, 40, 40 ), |
|
52 | - array('2011', 'Q1', 51, 42, 46 ), |
|
53 | - array('', 'Q2', 53, 58, 56 ), |
|
54 | - array('', 'Q3', 64, 66, 69 ), |
|
55 | - array('', 'Q4', 54, 55, 56 ), |
|
56 | - array('2012', 'Q1', 49, 52, 58 ), |
|
57 | - array('', 'Q2', 68, 73, 86 ), |
|
58 | - array('', 'Q3', 72, 78, 0 ), |
|
59 | - array('', 'Q4', 50, 60, 0 ), |
|
47 | + array('', '', 'Budget', 'Forecast', 'Actual'), |
|
48 | + array('2010', 'Q1', 47, 44, 43), |
|
49 | + array('', 'Q2', 56, 53, 50), |
|
50 | + array('', 'Q3', 52, 46, 45), |
|
51 | + array('', 'Q4', 45, 40, 40), |
|
52 | + array('2011', 'Q1', 51, 42, 46), |
|
53 | + array('', 'Q2', 53, 58, 56), |
|
54 | + array('', 'Q3', 64, 66, 69), |
|
55 | + array('', 'Q4', 54, 55, 56), |
|
56 | + array('2012', 'Q1', 49, 52, 58), |
|
57 | + array('', 'Q2', 68, 73, 86), |
|
58 | + array('', 'Q3', 72, 78, 0), |
|
59 | + array('', 'Q4', 50, 60, 0), |
|
60 | 60 | ) |
61 | 61 | ); |
62 | 62 | |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | // Data values |
69 | 69 | // Data Marker |
70 | 70 | $dataSeriesLabels = array( |
71 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 'Budget' |
|
72 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 'Forecast' |
|
73 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$E$1', NULL, 1), // 'Actual' |
|
71 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 'Budget' |
|
72 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 'Forecast' |
|
73 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$E$1', NULL, 1), // 'Actual' |
|
74 | 74 | ); |
75 | 75 | // Set the X-Axis Labels |
76 | 76 | // Datatype |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // Data values |
81 | 81 | // Data Marker |
82 | 82 | $xAxisTickValues = array( |
83 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$B$13', NULL, 12), // Q1 to Q4 for 2010 to 2012 |
|
83 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$B$13', NULL, 12), // Q1 to Q4 for 2010 to 2012 |
|
84 | 84 | ); |
85 | 85 | // Set the Data values for each data series we want to plot |
86 | 86 | // Datatype |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | |
98 | 98 | // Build the dataseries |
99 | 99 | $series = new \PHPExcel\Chart\DataSeries( |
100 | - \PHPExcel\Chart\DataSeries::TYPE_BARCHART, // plotType |
|
101 | - \PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping |
|
102 | - range(0, count($dataSeriesValues)-1), // plotOrder |
|
103 | - $dataSeriesLabels, // plotLabel |
|
104 | - $xAxisTickValues, // plotCategory |
|
100 | + \PHPExcel\Chart\DataSeries::TYPE_BARCHART, // plotType |
|
101 | + \PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping |
|
102 | + range(0, count($dataSeriesValues) - 1), // plotOrder |
|
103 | + $dataSeriesLabels, // plotLabel |
|
104 | + $xAxisTickValues, // plotCategory |
|
105 | 105 | $dataSeriesValues // plotValues |
106 | 106 | ); |
107 | 107 | // Set additional dataseries parameters |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | |
121 | 121 | // Create the chart |
122 | 122 | $chart = new \PHPExcel\Chart( |
123 | - 'chart1', // name |
|
124 | - $title, // title |
|
125 | - $legend, // legend |
|
126 | - $plotArea, // plotArea |
|
127 | - true, // plotVisibleOnly |
|
128 | - 0, // displayBlanksAs |
|
129 | - $xAxisLabel, // xAxisLabel |
|
123 | + 'chart1', // name |
|
124 | + $title, // title |
|
125 | + $legend, // legend |
|
126 | + $plotArea, // plotArea |
|
127 | + true, // plotVisibleOnly |
|
128 | + 0, // displayBlanksAs |
|
129 | + $xAxisLabel, // xAxisLabel |
|
130 | 130 | $yAxisLabel // yAxisLabel |
131 | 131 | ); |
132 | 132 | |
@@ -139,16 +139,16 @@ discard block |
||
139 | 139 | |
140 | 140 | |
141 | 141 | // Save Excel 2007 file |
142 | -echo date('H:i:s') , " Write to Excel2007 format" , EOL; |
|
142 | +echo date('H:i:s'), " Write to Excel2007 format", EOL; |
|
143 | 143 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007'); |
144 | 144 | $objWriter->setIncludeCharts(TRUE); |
145 | 145 | $objWriter->save(str_replace('.php', '.xlsx', __FILE__)); |
146 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
146 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
147 | 147 | |
148 | 148 | |
149 | 149 | // Echo memory peak usage |
150 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
150 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; |
|
151 | 151 | |
152 | 152 | // Echo done |
153 | -echo date('H:i:s') , " Done writing file" , EOL; |
|
154 | -echo 'File has been created in ' , getcwd() , EOL; |
|
153 | +echo date('H:i:s'), " Done writing file", EOL; |
|
154 | +echo 'File has been created in ', getcwd(), EOL; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file |
37 | 37 | PHPExcel\Settings::setZipClass(PHPExcel\Settings::PCLZIP); |
38 | 38 | |
39 | -echo date('H:i:s') , " Load from OOCalc file" , PHP_EOL; |
|
39 | +echo date('H:i:s'), " Load from OOCalc file", PHP_EOL; |
|
40 | 40 | $callStartTime = microtime(true); |
41 | 41 | |
42 | 42 | $objReader = \PHPExcel\IOFactory::createReader('OOCalc'); |
@@ -45,20 +45,20 @@ discard block |
||
45 | 45 | |
46 | 46 | $callEndTime = microtime(true); |
47 | 47 | $callTime = $callEndTime - $callStartTime; |
48 | -echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , PHP_EOL; |
|
48 | +echo 'Call time to read Workbook was ', sprintf('%.4f', $callTime), " seconds", PHP_EOL; |
|
49 | 49 | // Echo memory usage |
50 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; |
|
50 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", PHP_EOL; |
|
51 | 51 | |
52 | 52 | |
53 | -echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL; |
|
53 | +echo date('H:i:s'), " Write to Excel2007 format", PHP_EOL; |
|
54 | 54 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007'); |
55 | 55 | $objWriter->save(str_replace('.php', '.xlsx', __FILE__)); |
56 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL; |
|
56 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', __FILE__), PHP_EOL; |
|
57 | 57 | |
58 | 58 | |
59 | 59 | // Echo memory peak usage |
60 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; |
|
60 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", PHP_EOL; |
|
61 | 61 | |
62 | 62 | // Echo done |
63 | -echo date('H:i:s') , " Done writing file" , PHP_EOL; |
|
63 | +echo date('H:i:s'), " Done writing file", PHP_EOL; |
|
64 | 64 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | ini_set('display_errors', TRUE); |
30 | 30 | ini_set('display_startup_errors', TRUE); |
31 | 31 | |
32 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
32 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
33 | 33 | |
34 | 34 | date_default_timezone_set('Europe/London'); |
35 | 35 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ini_set('display_errors', TRUE); |
31 | 31 | ini_set('display_startup_errors', TRUE); |
32 | 32 | |
33 | -define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
33 | +define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); |
|
34 | 34 | |
35 | 35 | date_default_timezone_set('Europe/London'); |
36 | 36 | |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | // Create new PHPExcel object |
42 | -echo date('H:i:s') , " Create new PHPExcel object" , EOL; |
|
42 | +echo date('H:i:s'), " Create new PHPExcel object", EOL; |
|
43 | 43 | $objPHPExcel = new \PHPExcel\Spreadsheet(); |
44 | 44 | |
45 | 45 | // Set document properties |
46 | -echo date('H:i:s') , " Set document properties" , EOL; |
|
46 | +echo date('H:i:s'), " Set document properties", EOL; |
|
47 | 47 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
48 | 48 | ->setLastModifiedBy("Maarten Balliauw") |
49 | 49 | ->setTitle("Office 2007 XLSX Test Document") |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | |
56 | 56 | // Create a first sheet, representing sales data |
57 | -echo date('H:i:s') , " Add some data" , EOL; |
|
57 | +echo date('H:i:s'), " Add some data", EOL; |
|
58 | 58 | $objPHPExcel->setActiveSheetIndex(0); |
59 | 59 | $objPHPExcel->getActiveSheet() |
60 | 60 | ->setCellValue('A1', '-0.5') |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | |
77 | 77 | // Add conditional formatting |
78 | -echo date('H:i:s') , " Add conditional formatting" , EOL; |
|
78 | +echo date('H:i:s'), " Add conditional formatting", EOL; |
|
79 | 79 | $objConditional1 = new \PHPExcel\Style\Conditional(); |
80 | 80 | $objConditional1->setConditionType(\PHPExcel\Style\Conditional::CONDITION_CELLIS) |
81 | 81 | ->setOperatorType(\PHPExcel\Style\Conditional::OPERATOR_LESSTHAN) |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | |
97 | 97 | // duplicate the conditional styles across a range of cells |
98 | -echo date('H:i:s') , " Duplicate the conditional formatting across a range of cells" , EOL; |
|
98 | +echo date('H:i:s'), " Duplicate the conditional formatting across a range of cells", EOL; |
|
99 | 99 | $objPHPExcel->getActiveSheet()->duplicateConditionalStyle( |
100 | 100 | $objPHPExcel->getActiveSheet()->getStyle('A1')->getConditionalStyles(), |
101 | 101 | 'A2:A8' |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | |
105 | 105 | // Save Excel 2007 file |
106 | -echo date('H:i:s') , " Write to Excel2007 format" , EOL; |
|
106 | +echo date('H:i:s'), " Write to Excel2007 format", EOL; |
|
107 | 107 | $callStartTime = microtime(true); |
108 | 108 | |
109 | 109 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007'); |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | $callEndTime = microtime(true); |
112 | 112 | $callTime = $callEndTime - $callStartTime; |
113 | 113 | |
114 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
115 | -echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL; |
|
114 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
115 | +echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL; |
|
116 | 116 | // Save Excel5 file |
117 | -echo date('H:i:s') , " Write to Excel5 format" , EOL; |
|
117 | +echo date('H:i:s'), " Write to Excel5 format", EOL; |
|
118 | 118 | $callStartTime = microtime(true); |
119 | 119 | |
120 | 120 | $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5'); |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | $callEndTime = microtime(true); |
123 | 123 | $callTime = $callEndTime - $callStartTime; |
124 | 124 | |
125 | -echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL; |
|
126 | -echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL; |
|
125 | +echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL; |
|
126 | +echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL; |
|
127 | 127 | // Echo memory usage |
128 | -echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
128 | +echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL; |
|
129 | 129 | |
130 | 130 | |
131 | 131 | // Echo memory peak usage |
132 | -echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL; |
|
132 | +echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; |
|
133 | 133 | |
134 | 134 | // Echo done |
135 | -echo date('H:i:s') , " Done writing file" , EOL; |
|
136 | -echo 'File has been created in ' , getcwd() , EOL; |
|
135 | +echo date('H:i:s'), " Done writing file", EOL; |
|
136 | +echo 'File has been created in ', getcwd(), EOL; |