@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * Set the Default timezone to use for dates |
114 | 114 | * |
115 | - * @param string|\DateTimeZone $timezone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
115 | + * @param string|\DateTimeZone $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
116 | 116 | * @return boolean Success or failure |
117 | 117 | * @throws \Exception |
118 | 118 | */ |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * Validate a timezone |
143 | 143 | * |
144 | - * @param string|\DateTimeZone $timezone The timezone to validate, either as a timezone string or object |
|
144 | + * @param string|\DateTimeZone $timeZone The timezone to validate, either as a timezone string or object |
|
145 | 145 | * @return \DateTimeZone The timezone as a timezone object |
146 | 146 | * @throws \Exception |
147 | 147 | */ |
@@ -158,8 +158,7 @@ discard block |
||
158 | 158 | /** |
159 | 159 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object |
160 | 160 | * |
161 | - * @param integer|float $dateValue MS Excel serialized date/time value |
|
162 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
161 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
163 | 162 | * if you don't want to treat it as a UTC value |
164 | 163 | * Use the default (UST) unless you absolutely need a conversion |
165 | 164 | * @return \DateTime PHP date/time object |
@@ -196,8 +195,7 @@ discard block |
||
196 | 195 | /** |
197 | 196 | * Convert a MS serialized datetime value from Excel to a unix timestamp |
198 | 197 | * |
199 | - * @param integer|float $dateValue MS Excel serialized date/time value |
|
200 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
198 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
201 | 199 | * if you don't want to treat it as a UTC value |
202 | 200 | * Use the default (UST) unless you absolutely need a conversion |
203 | 201 | * @return integer Unix timetamp for this date/time |
@@ -213,7 +211,7 @@ discard block |
||
213 | 211 | /** |
214 | 212 | * Convert a date from PHP to Excel |
215 | 213 | * |
216 | - * @param mixed $dateValue PHP serialized date/time or date object |
|
214 | + * @param integer $dateValue PHP serialized date/time or date object |
|
217 | 215 | * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as |
218 | 216 | * a UST timestamp, or adjusted to UST |
219 | 217 | * @param string $timezone The timezone for finding the adjustment from UST |
@@ -254,7 +252,7 @@ discard block |
||
254 | 252 | * @param integer $hours |
255 | 253 | * @param integer $minutes |
256 | 254 | * @param integer $seconds |
257 | - * @return integer Excel date/time value |
|
255 | + * @return double Excel date/time value |
|
258 | 256 | */ |
259 | 257 | public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) |
260 | 258 | { |
@@ -2,26 +2,26 @@ |
||
2 | 2 | |
3 | 3 | // Excel DateTimeStamp Timezone Result Comments |
4 | 4 | return [ |
5 | - [ 22269, 'America/New_York', -285102000 ], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | - [ 25569, 'America/New_York', 18000 ], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | - [ 30292, 'America/New_York', 408085200 ], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | - [ 39611, 'America/New_York', 1213243200 ], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | - [ 50424, 'America/New_York', 2147490000 ], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | - [ 22345.56789, 'America/New_York', -278486534 ], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | - [ 22345.6789, 'America/New_York', -278476943 ], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | - [ 0.5, 'America/New_York', 61200 ], // 12:00:00 EST => 17:00:00 UTC |
|
13 | - [ 0.75, 'America/New_York', 82800 ], // 18:00.00 EST => 23:00:00 UTC |
|
14 | - [ 0.12345, 'America/New_York', 28666 ], // 02:57:46 EST => 07:57:46 UTC |
|
15 | - [ 41215, 'America/New_York', 1351828800 ], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | - [ 22269, 'Pacific/Auckland', -285163200 ], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | - [ 25569, 'Pacific/Auckland', -43200 ], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | - [ 30292, 'Pacific/Auckland', 408020400 ], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | - [ 39611, 'Pacific/Auckland', 1213185600 ], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | - [ 50423.5, 'Pacific/Auckland', 2147382000 ], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | - [ 22345.56789, 'Pacific/Auckland', -278547734 ], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | - [ 22345.6789, 'Pacific/Auckland', -278538143 ], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | - [ 0.5, 'Pacific/Auckland', 0 ], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | - [ 0.75, 'Pacific/Auckland', 21600 ], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | - [ 0.12345, 'Pacific/Auckland', -32534 ], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | - [ 41215, 'Pacific/Auckland', 1351767600 ], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
5 | + [ 22269, 'America/New_York', -285102000 ], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | + [ 25569, 'America/New_York', 18000 ], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | + [ 30292, 'America/New_York', 408085200 ], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | + [ 39611, 'America/New_York', 1213243200 ], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | + [ 50424, 'America/New_York', 2147490000 ], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | + [ 22345.56789, 'America/New_York', -278486534 ], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | + [ 22345.6789, 'America/New_York', -278476943 ], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | + [ 0.5, 'America/New_York', 61200 ], // 12:00:00 EST => 17:00:00 UTC |
|
13 | + [ 0.75, 'America/New_York', 82800 ], // 18:00.00 EST => 23:00:00 UTC |
|
14 | + [ 0.12345, 'America/New_York', 28666 ], // 02:57:46 EST => 07:57:46 UTC |
|
15 | + [ 41215, 'America/New_York', 1351828800 ], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | + [ 22269, 'Pacific/Auckland', -285163200 ], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | + [ 25569, 'Pacific/Auckland', -43200 ], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | + [ 30292, 'Pacific/Auckland', 408020400 ], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | + [ 39611, 'Pacific/Auckland', 1213185600 ], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | + [ 50423.5, 'Pacific/Auckland', 2147382000 ], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | + [ 22345.56789, 'Pacific/Auckland', -278547734 ], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | + [ 22345.6789, 'Pacific/Auckland', -278538143 ], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | + [ 0.5, 'Pacific/Auckland', 0 ], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | + [ 0.75, 'Pacific/Auckland', 21600 ], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | + [ 0.12345, 'Pacific/Auckland', -32534 ], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | + [ 41215, 'Pacific/Auckland', 1351767600 ], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
27 | 27 | ]; |
@@ -2,26 +2,26 @@ |
||
2 | 2 | |
3 | 3 | // Excel DateTimeStamp Timezone Result Comments |
4 | 4 | return [ |
5 | - [ 22269, 'America/New_York', -285102000 ], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | - [ 25569, 'America/New_York', 18000 ], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | - [ 30292, 'America/New_York', 408085200 ], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | - [ 39611, 'America/New_York', 1213243200 ], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | - [ 50424, 'America/New_York', 2147490000 ], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | - [ 22345.56789, 'America/New_York', -278486534 ], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | - [ 22345.6789, 'America/New_York', -278476943 ], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | - [ 0.5, 'America/New_York', 61200 ], // 12:00:00 EST => 17:00:00 UTC |
|
13 | - [ 0.75, 'America/New_York', 82800 ], // 18:00.00 EST => 23:00:00 UTC |
|
14 | - [ 0.12345, 'America/New_York', 28666 ], // 02:57:46 EST => 07:57:46 UTC |
|
15 | - [ 41215, 'America/New_York', 1351828800 ], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | - [ 22269, 'Pacific/Auckland', -285163200 ], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | - [ 25569, 'Pacific/Auckland', -43200 ], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | - [ 30292, 'Pacific/Auckland', 408020400 ], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | - [ 39611, 'Pacific/Auckland', 1213185600 ], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | - [ 50423.5, 'Pacific/Auckland', 2147382000 ], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | - [ 22345.56789, 'Pacific/Auckland', -278547734 ], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | - [ 22345.6789, 'Pacific/Auckland', -278538143 ], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | - [ 0.5, 'Pacific/Auckland', 0 ], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | - [ 0.75, 'Pacific/Auckland', 21600 ], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | - [ 0.12345, 'Pacific/Auckland', -32534 ], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | - [ 41215, 'Pacific/Auckland', 1351767600 ], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
5 | + [22269, 'America/New_York', -285102000], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | + [25569, 'America/New_York', 18000], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | + [30292, 'America/New_York', 408085200], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | + [39611, 'America/New_York', 1213243200], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | + [50424, 'America/New_York', 2147490000], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | + [22345.56789, 'America/New_York', -278486534], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | + [22345.6789, 'America/New_York', -278476943], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | + [0.5, 'America/New_York', 61200], // 12:00:00 EST => 17:00:00 UTC |
|
13 | + [0.75, 'America/New_York', 82800], // 18:00.00 EST => 23:00:00 UTC |
|
14 | + [0.12345, 'America/New_York', 28666], // 02:57:46 EST => 07:57:46 UTC |
|
15 | + [41215, 'America/New_York', 1351828800], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | + [22269, 'Pacific/Auckland', -285163200], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | + [25569, 'Pacific/Auckland', -43200], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | + [30292, 'Pacific/Auckland', 408020400], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | + [39611, 'Pacific/Auckland', 1213185600], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | + [50423.5, 'Pacific/Auckland', 2147382000], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | + [22345.56789, 'Pacific/Auckland', -278547734], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | + [22345.6789, 'Pacific/Auckland', -278538143], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | + [0.5, 'Pacific/Auckland', 0], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | + [0.75, 'Pacific/Auckland', 21600], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | + [0.12345, 'Pacific/Auckland', -32534], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | + [41215, 'Pacific/Auckland', 1351767600], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
27 | 27 | ]; |
@@ -2,40 +2,40 @@ |
||
2 | 2 | |
3 | 3 | // Excel Format Code Result |
4 | 4 | return [ |
5 | - [ 'General', FALSE ], |
|
6 | - [ '@', FALSE ], |
|
7 | - [ '0', FALSE ], |
|
8 | - [ '0.00', FALSE ], |
|
9 | - [ '#,##0.00', FALSE ], |
|
10 | - [ '#,##0.00_-', FALSE ], |
|
11 | - [ '0%', FALSE ], |
|
12 | - [ '0.00%', FALSE ], |
|
13 | - [ 'yyyy-mm-dd', TRUE ], |
|
14 | - [ 'yy-mm-dd', TRUE ], |
|
15 | - [ 'dd/mm/yy', TRUE ], |
|
16 | - [ 'd/m/y', TRUE ], |
|
17 | - [ 'd-m-y', TRUE ], |
|
18 | - [ 'd-m', TRUE ], |
|
19 | - [ 'm-y', TRUE ], |
|
20 | - [ 'mm-dd-yy', TRUE ], |
|
21 | - [ 'd-mmm-yy', TRUE ], |
|
22 | - [ 'd-mmm', TRUE ], |
|
23 | - [ 'mmm-yy', TRUE ], |
|
24 | - [ 'm/d/yy h:mm', TRUE ], |
|
25 | - [ 'd/m/y h:mm', TRUE ], |
|
26 | - [ 'h:mm AM/PM', TRUE ], |
|
27 | - [ 'h:mm:ss AM/PM', TRUE ], |
|
28 | - [ 'h:mm', TRUE ], |
|
29 | - [ 'h:mm:ss', TRUE ], |
|
30 | - [ 'mm:ss', TRUE ], |
|
31 | - [ 'h:mm:ss', TRUE ], |
|
32 | - [ 'i:s.S', TRUE ], |
|
33 | - [ 'h:mm:ss;@', TRUE ], |
|
34 | - [ 'yy/mm/dd;@', TRUE ], |
|
35 | - [ '"$" #,##0.00_-', FALSE ], |
|
36 | - [ '$#,##0_-', FALSE ], |
|
37 | - [ '[$EUR ]#,##0.00_-', FALSE ], |
|
38 | - [ '_[$EUR ]#,##0.00_-', FALSE ], |
|
39 | - [ '[Green]#,##0.00;[Red]#,##0.00_-', FALSE ], |
|
40 | - [ '#,##0.00 "dollars"', FALSE ], |
|
5 | + [ 'General', FALSE ], |
|
6 | + [ '@', FALSE ], |
|
7 | + [ '0', FALSE ], |
|
8 | + [ '0.00', FALSE ], |
|
9 | + [ '#,##0.00', FALSE ], |
|
10 | + [ '#,##0.00_-', FALSE ], |
|
11 | + [ '0%', FALSE ], |
|
12 | + [ '0.00%', FALSE ], |
|
13 | + [ 'yyyy-mm-dd', TRUE ], |
|
14 | + [ 'yy-mm-dd', TRUE ], |
|
15 | + [ 'dd/mm/yy', TRUE ], |
|
16 | + [ 'd/m/y', TRUE ], |
|
17 | + [ 'd-m-y', TRUE ], |
|
18 | + [ 'd-m', TRUE ], |
|
19 | + [ 'm-y', TRUE ], |
|
20 | + [ 'mm-dd-yy', TRUE ], |
|
21 | + [ 'd-mmm-yy', TRUE ], |
|
22 | + [ 'd-mmm', TRUE ], |
|
23 | + [ 'mmm-yy', TRUE ], |
|
24 | + [ 'm/d/yy h:mm', TRUE ], |
|
25 | + [ 'd/m/y h:mm', TRUE ], |
|
26 | + [ 'h:mm AM/PM', TRUE ], |
|
27 | + [ 'h:mm:ss AM/PM', TRUE ], |
|
28 | + [ 'h:mm', TRUE ], |
|
29 | + [ 'h:mm:ss', TRUE ], |
|
30 | + [ 'mm:ss', TRUE ], |
|
31 | + [ 'h:mm:ss', TRUE ], |
|
32 | + [ 'i:s.S', TRUE ], |
|
33 | + [ 'h:mm:ss;@', TRUE ], |
|
34 | + [ 'yy/mm/dd;@', TRUE ], |
|
35 | + [ '"$" #,##0.00_-', FALSE ], |
|
36 | + [ '$#,##0_-', FALSE ], |
|
37 | + [ '[$EUR ]#,##0.00_-', FALSE ], |
|
38 | + [ '_[$EUR ]#,##0.00_-', FALSE ], |
|
39 | + [ '[Green]#,##0.00;[Red]#,##0.00_-', FALSE ], |
|
40 | + [ '#,##0.00 "dollars"', FALSE ], |
|
41 | 41 | ]; |
@@ -2,40 +2,40 @@ |
||
2 | 2 | |
3 | 3 | // Excel Format Code Result |
4 | 4 | return [ |
5 | - [ 'General', FALSE ], |
|
6 | - [ '@', FALSE ], |
|
7 | - [ '0', FALSE ], |
|
8 | - [ '0.00', FALSE ], |
|
9 | - [ '#,##0.00', FALSE ], |
|
10 | - [ '#,##0.00_-', FALSE ], |
|
11 | - [ '0%', FALSE ], |
|
12 | - [ '0.00%', FALSE ], |
|
13 | - [ 'yyyy-mm-dd', TRUE ], |
|
14 | - [ 'yy-mm-dd', TRUE ], |
|
15 | - [ 'dd/mm/yy', TRUE ], |
|
16 | - [ 'd/m/y', TRUE ], |
|
17 | - [ 'd-m-y', TRUE ], |
|
18 | - [ 'd-m', TRUE ], |
|
19 | - [ 'm-y', TRUE ], |
|
20 | - [ 'mm-dd-yy', TRUE ], |
|
21 | - [ 'd-mmm-yy', TRUE ], |
|
22 | - [ 'd-mmm', TRUE ], |
|
23 | - [ 'mmm-yy', TRUE ], |
|
24 | - [ 'm/d/yy h:mm', TRUE ], |
|
25 | - [ 'd/m/y h:mm', TRUE ], |
|
26 | - [ 'h:mm AM/PM', TRUE ], |
|
27 | - [ 'h:mm:ss AM/PM', TRUE ], |
|
28 | - [ 'h:mm', TRUE ], |
|
29 | - [ 'h:mm:ss', TRUE ], |
|
30 | - [ 'mm:ss', TRUE ], |
|
31 | - [ 'h:mm:ss', TRUE ], |
|
32 | - [ 'i:s.S', TRUE ], |
|
33 | - [ 'h:mm:ss;@', TRUE ], |
|
34 | - [ 'yy/mm/dd;@', TRUE ], |
|
35 | - [ '"$" #,##0.00_-', FALSE ], |
|
36 | - [ '$#,##0_-', FALSE ], |
|
37 | - [ '[$EUR ]#,##0.00_-', FALSE ], |
|
38 | - [ '_[$EUR ]#,##0.00_-', FALSE ], |
|
39 | - [ '[Green]#,##0.00;[Red]#,##0.00_-', FALSE ], |
|
40 | - [ '#,##0.00 "dollars"', FALSE ], |
|
5 | + ['General', FALSE], |
|
6 | + ['@', FALSE], |
|
7 | + ['0', FALSE], |
|
8 | + ['0.00', FALSE], |
|
9 | + ['#,##0.00', FALSE], |
|
10 | + ['#,##0.00_-', FALSE], |
|
11 | + ['0%', FALSE], |
|
12 | + ['0.00%', FALSE], |
|
13 | + ['yyyy-mm-dd', TRUE], |
|
14 | + ['yy-mm-dd', TRUE], |
|
15 | + ['dd/mm/yy', TRUE], |
|
16 | + ['d/m/y', TRUE], |
|
17 | + ['d-m-y', TRUE], |
|
18 | + ['d-m', TRUE], |
|
19 | + ['m-y', TRUE], |
|
20 | + ['mm-dd-yy', TRUE], |
|
21 | + ['d-mmm-yy', TRUE], |
|
22 | + ['d-mmm', TRUE], |
|
23 | + ['mmm-yy', TRUE], |
|
24 | + ['m/d/yy h:mm', TRUE], |
|
25 | + ['d/m/y h:mm', TRUE], |
|
26 | + ['h:mm AM/PM', TRUE], |
|
27 | + ['h:mm:ss AM/PM', TRUE], |
|
28 | + ['h:mm', TRUE], |
|
29 | + ['h:mm:ss', TRUE], |
|
30 | + ['mm:ss', TRUE], |
|
31 | + ['h:mm:ss', TRUE], |
|
32 | + ['i:s.S', TRUE], |
|
33 | + ['h:mm:ss;@', TRUE], |
|
34 | + ['yy/mm/dd;@', TRUE], |
|
35 | + ['"$" #,##0.00_-', FALSE], |
|
36 | + ['$#,##0_-', FALSE], |
|
37 | + ['[$EUR ]#,##0.00_-', FALSE], |
|
38 | + ['_[$EUR ]#,##0.00_-', FALSE], |
|
39 | + ['[Green]#,##0.00;[Red]#,##0.00_-', FALSE], |
|
40 | + ['#,##0.00 "dollars"', FALSE], |
|
41 | 41 | ]; |
@@ -29,105 +29,105 @@ |
||
29 | 29 | error_reporting(E_ALL); |
30 | 30 | |
31 | 31 | if (PHP_SAPI != 'cli') { |
32 | - die ('This script executes all tests, and should only be run from the command line'); |
|
32 | + die ('This script executes all tests, and should only be run from the command line'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // List of tests |
36 | 36 | $aTests = array( |
37 | - '01simple.php' |
|
38 | - , '01simplePCLZip.php' |
|
39 | - , '02types.php' |
|
40 | - , '02types-xls.php' |
|
41 | - , '03formulas.php' |
|
42 | - , '04printing.php' |
|
43 | - , '05featuredemo.php' |
|
44 | - , '06largescale.php' |
|
45 | - , '06largescale-with-cellcaching.php' |
|
46 | - , '06largescale-with-cellcaching-sqlite.php' |
|
47 | - , '06largescale-with-cellcaching-sqlite3.php' |
|
48 | - , '06largescale-xls.php' |
|
49 | - , '07reader.php' |
|
50 | - , '07readerPCLZip.php' |
|
51 | - , '08conditionalformatting.php' |
|
52 | - , '08conditionalformatting2.php' |
|
53 | - , '09pagebreaks.php' |
|
54 | - , '10autofilter.php' |
|
55 | - , '10autofilter-selection-1.php' |
|
56 | - , '10autofilter-selection-2.php' |
|
57 | - , '10autofilter-selection-display.php' |
|
58 | - , '11documentsecurity.php' |
|
59 | - , '11documentsecurity-xls.php' |
|
60 | - , '12cellProtection.php' |
|
61 | - , '13calculation.php' |
|
37 | + '01simple.php' |
|
38 | + , '01simplePCLZip.php' |
|
39 | + , '02types.php' |
|
40 | + , '02types-xls.php' |
|
41 | + , '03formulas.php' |
|
42 | + , '04printing.php' |
|
43 | + , '05featuredemo.php' |
|
44 | + , '06largescale.php' |
|
45 | + , '06largescale-with-cellcaching.php' |
|
46 | + , '06largescale-with-cellcaching-sqlite.php' |
|
47 | + , '06largescale-with-cellcaching-sqlite3.php' |
|
48 | + , '06largescale-xls.php' |
|
49 | + , '07reader.php' |
|
50 | + , '07readerPCLZip.php' |
|
51 | + , '08conditionalformatting.php' |
|
52 | + , '08conditionalformatting2.php' |
|
53 | + , '09pagebreaks.php' |
|
54 | + , '10autofilter.php' |
|
55 | + , '10autofilter-selection-1.php' |
|
56 | + , '10autofilter-selection-2.php' |
|
57 | + , '10autofilter-selection-display.php' |
|
58 | + , '11documentsecurity.php' |
|
59 | + , '11documentsecurity-xls.php' |
|
60 | + , '12cellProtection.php' |
|
61 | + , '13calculation.php' |
|
62 | 62 | , '13calculationCyclicFormulae.php' |
63 | - , '14excel5.php' |
|
64 | - , '15datavalidation.php' |
|
65 | - , '15datavalidation-xls.php' |
|
66 | - , '16csv.php' |
|
67 | - , '17html.php' |
|
68 | - , '18extendedcalculation.php' |
|
69 | - , '19namedrange.php' |
|
70 | - , '20readexcel5.php' |
|
71 | - , '21pdf.php' |
|
72 | - , '22heavilyformatted.php' |
|
73 | - , '23sharedstyles.php' |
|
74 | - , '24readfilter.php' |
|
75 | - , '25inmemoryimage.php' |
|
76 | - , '26utf8.php' |
|
77 | - , '27imagesexcel5.php' |
|
78 | - , '28iterator.php' |
|
79 | - , '29advancedvaluebinder.php' |
|
80 | - , '30template.php' |
|
81 | - , '31docproperties_write.php' |
|
82 | - , '31docproperties_write-xls.php' |
|
83 | - , '32chartreadwrite.php' |
|
84 | - , '33chartcreate-area.php' |
|
85 | - , '33chartcreate-bar.php' |
|
86 | - , '33chartcreate-bar-stacked.php' |
|
87 | - , '33chartcreate-column.php' |
|
88 | - , '33chartcreate-column-2.php' |
|
89 | - , '33chartcreate-line.php' |
|
90 | - , '33chartcreate-pie.php' |
|
91 | - , '33chartcreate-radar.php' |
|
92 | - , '33chartcreate-scatter.php' |
|
93 | - , '33chartcreate-stock.php' |
|
94 | - , '33chartcreate-multiple-charts.php' |
|
95 | - , '33chartcreate-composite.php' |
|
96 | - , '34chartupdate.php' |
|
97 | - , '35chartrender.php' |
|
98 | - , '36chartreadwriteHTML.php' |
|
99 | - , '36chartreadwritePDF.php' |
|
100 | - , '37page_layout_view.php' |
|
101 | - , '38cloneWorksheet.php' |
|
63 | + , '14excel5.php' |
|
64 | + , '15datavalidation.php' |
|
65 | + , '15datavalidation-xls.php' |
|
66 | + , '16csv.php' |
|
67 | + , '17html.php' |
|
68 | + , '18extendedcalculation.php' |
|
69 | + , '19namedrange.php' |
|
70 | + , '20readexcel5.php' |
|
71 | + , '21pdf.php' |
|
72 | + , '22heavilyformatted.php' |
|
73 | + , '23sharedstyles.php' |
|
74 | + , '24readfilter.php' |
|
75 | + , '25inmemoryimage.php' |
|
76 | + , '26utf8.php' |
|
77 | + , '27imagesexcel5.php' |
|
78 | + , '28iterator.php' |
|
79 | + , '29advancedvaluebinder.php' |
|
80 | + , '30template.php' |
|
81 | + , '31docproperties_write.php' |
|
82 | + , '31docproperties_write-xls.php' |
|
83 | + , '32chartreadwrite.php' |
|
84 | + , '33chartcreate-area.php' |
|
85 | + , '33chartcreate-bar.php' |
|
86 | + , '33chartcreate-bar-stacked.php' |
|
87 | + , '33chartcreate-column.php' |
|
88 | + , '33chartcreate-column-2.php' |
|
89 | + , '33chartcreate-line.php' |
|
90 | + , '33chartcreate-pie.php' |
|
91 | + , '33chartcreate-radar.php' |
|
92 | + , '33chartcreate-scatter.php' |
|
93 | + , '33chartcreate-stock.php' |
|
94 | + , '33chartcreate-multiple-charts.php' |
|
95 | + , '33chartcreate-composite.php' |
|
96 | + , '34chartupdate.php' |
|
97 | + , '35chartrender.php' |
|
98 | + , '36chartreadwriteHTML.php' |
|
99 | + , '36chartreadwritePDF.php' |
|
100 | + , '37page_layout_view.php' |
|
101 | + , '38cloneWorksheet.php' |
|
102 | 102 | , '39dropdown.php' |
103 | - , '40duplicateStyle.php' |
|
104 | - , '41password.php' |
|
105 | - , '42richText.php' |
|
103 | + , '40duplicateStyle.php' |
|
104 | + , '41password.php' |
|
105 | + , '42richText.php' |
|
106 | 106 | , '43mergeWorkbooks.php' |
107 | 107 | , '44worksheetInfo.php' |
108 | - , 'OOCalcReader.php' |
|
109 | - , 'OOCalcReaderPCLZip.php' |
|
110 | - , 'SylkReader.php' |
|
111 | - , 'Excel2003XMLReader.php' |
|
112 | - , 'XMLReader.php' |
|
113 | - , 'GnumericReader.php' |
|
108 | + , 'OOCalcReader.php' |
|
109 | + , 'OOCalcReaderPCLZip.php' |
|
110 | + , 'SylkReader.php' |
|
111 | + , 'Excel2003XMLReader.php' |
|
112 | + , 'XMLReader.php' |
|
113 | + , 'GnumericReader.php' |
|
114 | 114 | ); |
115 | 115 | |
116 | 116 | // First, clear all previous run results |
117 | 117 | foreach ($aTests as $sTest) { |
118 | - @unlink( str_replace('.php', '.xls', $sTest) ); |
|
119 | - @unlink( str_replace('.php', '.xlsx', $sTest) ); |
|
120 | - @unlink( str_replace('.php', '.csv', $sTest) ); |
|
121 | - @unlink( str_replace('.php', '.htm', $sTest) ); |
|
122 | - @unlink( str_replace('.php', '.pdf', $sTest) ); |
|
118 | + @unlink( str_replace('.php', '.xls', $sTest) ); |
|
119 | + @unlink( str_replace('.php', '.xlsx', $sTest) ); |
|
120 | + @unlink( str_replace('.php', '.csv', $sTest) ); |
|
121 | + @unlink( str_replace('.php', '.htm', $sTest) ); |
|
122 | + @unlink( str_replace('.php', '.pdf', $sTest) ); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | // Run all tests |
126 | 126 | foreach ($aTests as $sTest) { |
127 | - echo '============== TEST ==============' . "\r\n"; |
|
128 | - echo 'Test name: ' . $sTest . "\r\n"; |
|
129 | - echo "\r\n"; |
|
130 | - echo shell_exec('php ' . $sTest); |
|
131 | - echo "\r\n"; |
|
132 | - echo "\r\n"; |
|
127 | + echo '============== TEST ==============' . "\r\n"; |
|
128 | + echo 'Test name: ' . $sTest . "\r\n"; |
|
129 | + echo "\r\n"; |
|
130 | + echo shell_exec('php ' . $sTest); |
|
131 | + echo "\r\n"; |
|
132 | + echo "\r\n"; |
|
133 | 133 | } |
134 | 134 | \ No newline at end of file |