Skip to content

Commit 3ba7a86

Browse files
PowerKiKiMirocow
authored andcommitted
Rename Excel2007 into Xlsx
FIX PHPOffice#5
1 parent 00440eb commit 3ba7a86

File tree

81 files changed

+376
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+376
-356
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2929
- c:max and c:min elements shall NOT be inside c:orientation elements - @vitalyrepin [#869](https://github.com/PHPOffice/PHPExcel/pull/869)
3030
- Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel - @sim642 [#489](https://github.com/PHPOffice/PHPExcel/pull/489)
3131

32+
### BREAKING CHANGE
33+
34+
- Introduction of namespaces for all classes, eg: `PHPExcel_Calculation_Function` becomes `PhpOffice\PhpSpreadsheet\Calculation\Functions`
35+
- Some classes were renamed for clarity and/or consistency:
36+
37+
| Before | After |
38+
|---------------------------------|-------------------------------------------|
39+
| `PHPExcel` | `PhpOffice\PhpSpreadsheet\Spreadsheet` |
40+
| `PHPExcel_Reader_Excel2007` | `PhpOffice\PhpSpreadsheet\Reader\Xlsx` |
41+
| `PHPExcel_Writer_Excel2007` | `PhpOffice\PhpSpreadsheet\Writer\Xlsx` |
42+
43+
- Some methods were renamed for clarity and/or consistency:
44+
45+
| Before | After |
46+
|--------------------------------------------------|------------------------------------------------------------|
47+
| `PHPExcel_Calculation_DateTime::DAYOFWEEK()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKDAY()` |
48+
| `PHPExcel_Calculation_DateTime::WEEKOFYEAR()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKNUM()` |
49+
| `PHPExcel_Calculation_DateTime::MINUTEOFHOUR()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE()` |
50+
| `PHPExcel_Calculation_DateTime::SECONDOFMINUTE()`| `PhpOffice\PhpSpreadsheet\Calculation\DateTime::SECOND()` |
51+
3252

3353
## [1.8.1] - 2015-04-30
3454

Documentation/Examples/Reader/exampleReader03.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'SYLK';

Documentation/Examples/Reader/exampleReader05.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader06.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader07.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader08.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader09.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader10.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader11.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader12.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader17.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader18.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reader/exampleReader19.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
$inputFileType = 'Excel5';
30-
// $inputFileType = 'Excel2007';
30+
// $inputFileType = 'Xlsx';
3131
// $inputFileType = 'Excel2003XML';
3232
// $inputFileType = 'OOCalc';
3333
// $inputFileType = 'Gnumeric';

Documentation/Examples/Reading WorkBook Data/exampleWorkBookReader02.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
include 'PHPExcel/IOFactory.php';
2727

2828

29-
$inputFileType = 'Excel2007';
29+
$inputFileType = 'Xlsx';
3030
$inputFileName = './sampleData/example1.xlsx';
3131

3232
/** Create a new Reader of the type defined in $inputFileType **/

Documentation/Examples/Reading WorkBook Data/exampleWorkBookReader03.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
include 'PHPExcel/IOFactory.php';
2727

2828

29-
$inputFileType = 'Excel2007';
29+
$inputFileType = 'Xlsx';
3030
$inputFileName = './sampleData/example1.xlsx';
3131

3232
/** Create a new Reader of the type defined in $inputFileType **/

Documentation/markdown/CalculationEngine/FunctionReference/01-Introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ The up-to-date F.A.Q. page for PHPExcel can be found on [http://www.codeplex.com
66

77
### Formulas don’t seem to be calculated in Excel2003 using compatibility pack?
88

9-
This is normal behaviour of the compatibility pack, Excel2007 displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
9+
This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
1010

1111
[1]: http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements

Documentation/markdown/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ DATEVALUE uses the php date/time object implementation of strtotime() (which can
299299

300300
__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value.
301301

302-
Care should be taken in workbooks that use string formatted dates in calculations when writing to Excel5 or Excel2007.
302+
Care should be taken in workbooks that use string formatted dates in calculations when writing to Excel5 or Xlsx.
303303

304304
#### DAY
305305

Documentation/markdown/Features/Autofilters/03-Autofilter-Expressions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Autofilter Expressions
55

6-
PHPEXcel 1.7.8 introduced the ability to actually create, read and write filter expressions; initially only for Excel2007 files, but later releases will extend this to other formats.
6+
PHPEXcel 1.7.8 introduced the ability to actually create, read and write filter expressions; initially only for Xlsx files, but later releases will extend this to other formats.
77

88
To apply a filter expression to an autoFilter range, you first need to identify which column you're going to be applying this filter to.
99

Documentation/markdown/Overview/01-Getting-Started.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script u
7373

7474
Make sure you meet all requirements, especially php_zip extension should be enabled.
7575

76-
The ZipArchive class is only required when reading or writing formats that use Zip compression (Excel2007 and OOCalc). Since version 1.7.6 the PCLZip library has been bundled with PHPExcel as an alternative to the ZipArchive class.
76+
The ZipArchive class is only required when reading or writing formats that use Zip compression (Xlsx and OOCalc). Since version 1.7.6 the PCLZip library has been bundled with PHPExcel as an alternative to the ZipArchive class.
7777

7878
This can be enabled by calling:
7979
```php
8080
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
8181
```
82-
*before* calling the save method of the Excel2007 Writer.
82+
*before* calling the save method of the Xlsx Writer.
8383

8484
You can revert to using ZipArchive by calling:
8585
```php
8686
PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);
8787
```
88-
At present, this only allows you to write Excel2007 files without the need for ZipArchive (not to read Excel2007 or OOCalc)
88+
At present, this only allows you to write Xlsx files without the need for ZipArchive (not to read Xlsx or OOCalc)
8989

9090
##### Excel 2007 cannot open the file generated by PHPExcel_Writer_2007 on Windows
9191

@@ -95,7 +95,7 @@ Some older versions of the 5.2.x php_zip extension on Windows contain an error w
9595

9696
Alternatively, upgrading to at least PHP 5.2.9 should solve the problem.
9797

98-
If you can't locate a clean copy of ZipArchive, then you can use the PCLZip library as an alternative when writing Excel2007 files, as described above.
98+
If you can't locate a clean copy of ZipArchive, then you can use the PCLZip library as an alternative when writing Xlsx files, as described above.
9999

100100
##### Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa
101101

@@ -122,7 +122,7 @@ We are slowly building up a list of features, together with the different reader
122122

123123
##### Formulas don't seem to be calculated in Excel2003 using compatibility pack?
124124

125-
This is normal behaviour of the compatibility pack, Excel2007 displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
125+
This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
126126

127127
##### Setting column width is not 100% accurate
128128

@@ -177,5 +177,5 @@ Thanks to peterrlynch for the following advice on resolving issues between the [
177177
[21]: http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html
178178

179179

180-
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.<br />You can remove this dependency for writing Excel2007 files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.
180+
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.<br />You can remove this dependency for writing Xlsx files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.
181181

Documentation/markdown/Overview/07-Accessing-Cells.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ $objPHPExcel->getActiveSheet()->getStyle('A10')
127127
![07-simple-example-1.png](./images/07-simple-example-1.png "")
128128

129129

130-
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Excel2007 and Excel5).
130+
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Xlsx and Excel5).
131131

132132
### Setting a range of cells from an array
133133

@@ -266,7 +266,7 @@ The easiest way to loop cells is by using iterators. Using iterators, one can us
266266
Below is an example where we read all the values in a worksheet and display them in a table.
267267

268268
```php
269-
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
269+
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
270270
$objReader->setReadDataOnly(TRUE);
271271
$objPHPExcel = $objReader->load("test.xlsx");
272272

@@ -304,7 +304,7 @@ Note: In PHPExcel column index is 0-based while row index is 1-based. That means
304304
Below is an example where we read all the values in a worksheet and display them in a table.
305305

306306
```php
307-
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
307+
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
308308
$objReader->setReadDataOnly(TRUE);
309309
$objPHPExcel = $objReader->load("test.xlsx");
310310

@@ -331,7 +331,7 @@ echo '</table>' . PHP_EOL;
331331
Alternatively, you can take advantage of PHP's "Perl-style" character incrementors to loop through the cells by coordinate:
332332

333333
```php
334-
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
334+
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
335335
$objReader->setReadDataOnly(TRUE);
336336
$objPHPExcel = $objReader->load("test.xlsx");
337337

Documentation/markdown/Overview/08-Recipes.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ The first occurrence of the following codes turns the formatting ON, the second
328328

329329
Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, while the first is ON.
330330

331-
The following codes are supported by Excel2007:
331+
The following codes are supported by Xlsx:
332332

333333
Code | Meaning
334334
-----------------------|-----------
@@ -545,10 +545,10 @@ $objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
545545
__Tip__
546546
The rules for composing a number format code in Excel can be rather complicated. Sometimes you know how to create some number format in Microsoft Office Excel, but don't know what the underlying number format code looks like. How do you find it?
547547

548-
The readers shipped with PHPExcel come to the rescue. Load your template workbook using e.g. Excel2007 reader to reveal the number format code. Example how read a number format code for cell A1:
548+
The readers shipped with PHPExcel come to the rescue. Load your template workbook using e.g. Xlsx reader to reveal the number format code. Example how read a number format code for cell A1:
549549

550550
```php
551-
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
551+
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
552552
$objPHPExcel = $objReader->load('template.xlsx');
553553
var_dump($objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode());
554554
```
@@ -745,7 +745,7 @@ $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
745745

746746
### Setting data validation on a cell
747747

748-
Data validation is a powerful feature of Excel2007. It allows to specify an input filter on the data that can be inserted in a specific cell. This filter can be a range (i.e. value must be between 0 and 10), a list (i.e. value must be picked from a list), ...
748+
Data validation is a powerful feature of Xlsx. It allows to specify an input filter on the data that can be inserted in a specific cell. This filter can be a range (i.e. value must be between 0 and 10), a list (i.e. value must be picked from a list), ...
749749

750750
The following piece of code only allows numbers between 10 and 20 to be entered in cell B3:
751751

@@ -1078,7 +1078,7 @@ header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetm
10781078
header('Content-Disposition: attachment;filename="myfile.xlsx"');
10791079
header('Cache-Control: max-age=0');
10801080

1081-
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
1081+
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xlsx');
10821082
$objWriter->save('php://output');
10831083
```
10841084

Documentation/markdown/Overview/10-Reading-and-Writing.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $objReader->load("05featuredemo.xlsx");
3535
You can create a PHPExcel_Reader_IReader instance using PHPExcel_IOFactory in explicit mode using the following code sample:
3636

3737
```php
38-
$objReader = PHPExcel_IOFactory::createReader("Excel2007");
38+
$objReader = PHPExcel_IOFactory::createReader("Xlsx");
3939
$objPHPExcel = $objReader->load("05featuredemo.xlsx");
4040
```
4141

@@ -46,13 +46,13 @@ Note that automatic type resolving mode is slightly slower than explicit mode.
4646
You can create a PHPExcel_Writer_Iwriter instance using PHPExcel_IOFactory:
4747

4848
```php
49-
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel2007");
49+
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Xlsx");
5050
$objWriter->save("05featuredemo.xlsx");
5151
```
5252

5353
### Excel 2007 (SpreadsheetML) file format
5454

55-
Excel2007 file format is the main file format of PHPExcel. It allows outputting the in-memory spreadsheet to a .xlsx file.
55+
Xlsx file format is the main file format of PHPExcel. It allows outputting the in-memory spreadsheet to a .xlsx file.
5656

5757
#### PHPExcel_Reader_Excel2007
5858

@@ -131,7 +131,7 @@ $objWriter->save("05featuredemo.xlsx");
131131

132132
##### Office 2003 compatibility pack
133133

134-
Because of a bug in the Office2003 compatibility pack, there can be some small issues when opening Excel2007 spreadsheets (mostly related to formula calculation). You can enable Office2003 compatibility with the following code:
134+
Because of a bug in the Office2003 compatibility pack, there can be some small issues when opening Xlsx spreadsheets (mostly related to formula calculation). You can enable Office2003 compatibility with the following code:
135135

136136
```
137137
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);

Documentation/markdown/ReadingSpreadsheetFiles/01-File-Formats.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary file for
1515

1616
Microsoft Excel™ 2003 included options for a file format called SpreadsheetML. This file is a zipped XML document. It is not very common, but its core features are supported. Documentation for the format can be found at [http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx][3] though it’s sadly rather sparse in its detail.
1717

18-
### Excel2007
18+
### Xlsx
1919

2020
Microsoft Excel™ 2007 shipped with a new file format, namely Microsoft Office Open XML SpreadsheetML, and Excel 2010 extended this still further with its new features such as sparklines. These files typically have an extension of .xlsx. This format is based around a zipped collection of eXtensible Markup Language (XML) files. Microsoft Office Open XML SpreadsheetML is mostly standardized in ECMA 376 ([http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm][4]) and ISO 29500.
2121

Documentation/markdown/ReadingSpreadsheetFiles/04-Loading-with-a-Reader.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Alternatively, you can use the IO Factory's createReader() method to instantiate
2525

2626
```php
2727
$inputFileType = 'Excel5';
28-
// $inputFileType = 'Excel2007';
28+
// $inputFileType = 'Xlsx';
2929
// $inputFileType = 'Excel2003XML';
3030
// $inputFileType = 'OOCalc';
3131
// $inputFileType = 'SYLK';

0 commit comments

Comments
 (0)