Skip to content

Commit 8ce1386

Browse files
author
MarkBaker
committed
Merge branch 'master' into PhpBench-Performance-in-CI
2 parents d4c96da + 0aedef4 commit 8ce1386

File tree

86 files changed

+3094
-817
lines changed

Some content is hidden

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

86 files changed

+3094
-817
lines changed

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org).
99

1010
### Added
1111

12-
- Add point size option for scatter charts
12+
- Add point size option for scatter charts [Issue #2298](https://github.com/PHPOffice/PhpSpreadsheet/issues/2298) [PR #2801](https://github.com/PHPOffice/PhpSpreadsheet/pull/2801)
13+
- Basic support for Xlsx reading/writing Chart Sheets [PR #2830](https://github.com/PHPOffice/PhpSpreadsheet/pull/2830)
14+
15+
Note that a ChartSheet is still only written as a normal Worksheet containing a single chart, not as an actual ChartSheet.
16+
17+
- Added Worksheet visibility in Ods Reader [PR #2851](https://github.com/PHPOffice/PhpSpreadsheet/pull/2851) and Gnumeric Reader [PR #2853](https://github.com/PHPOffice/PhpSpreadsheet/pull/2853)
18+
- Added Worksheet visibility in Ods Writer [PR #2850](https://github.com/PHPOffice/PhpSpreadsheet/pull/2850)
19+
- Allow Csv Reader to treat string as contents of file [Issue #1285](https://github.com/PHPOffice/PhpSpreadsheet/issues/1285) [PR #2792](https://github.com/PHPOffice/PhpSpreadsheet/pull/2792)
20+
- Allow Csv Reader to store null string rather than leave cell empty [Issue #2840](https://github.com/PHPOffice/PhpSpreadsheet/issues/2840) [PR #2842](https://github.com/PHPOffice/PhpSpreadsheet/pull/2842)
1321

1422
### Changed
1523

1624
- Memory and speed improvements, particularly for the Cell Collection, and the Writers.
1725

18-
See [the Discussion](https://github.com/PHPOffice/PhpSpreadsheet/discussions/2821) for details of performance
26+
See [the Discussion section on github](https://github.com/PHPOffice/PhpSpreadsheet/discussions/2821) for details of performance across versions
1927

2028
### Deprecated
2129

@@ -28,7 +36,12 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2836
### Fixed
2937

3038
- Xls Reader resolving absolute named ranges to relative ranges [Issue #2826](https://github.com/PHPOffice/PhpSpreadsheet/issues/2826) [PR #2827](https://github.com/PHPOffice/PhpSpreadsheet/pull/2827)
31-
39+
- Null value handling in the Excel Math/Trig PRODUCT() function [Issue #2833](https://github.com/PHPOffice/PhpSpreadsheet/issues/2833) [PR #2834](https://github.com/PHPOffice/PhpSpreadsheet/pull/2834)
40+
- Invalid Print Area defined in Xlsx corrupts internal storage of print area [Issue #2848](https://github.com/PHPOffice/PhpSpreadsheet/issues/2848) [PR #2849](https://github.com/PHPOffice/PhpSpreadsheet/pull/2849)
41+
- Time interval formatting [Issue #2768](https://github.com/PHPOffice/PhpSpreadsheet/issues/2768) [PR #2772](https://github.com/PHPOffice/PhpSpreadsheet/pull/2772)
42+
- Copy from Xls(x) to Html/Pdf loses drawings [PR #2788](https://github.com/PHPOffice/PhpSpreadsheet/pull/2788)
43+
- Html Reader converting cell containing 0 to null string [Issue #2810](https://github.com/PHPOffice/PhpSpreadsheet/issues/2810) [PR #2813](https://github.com/PHPOffice/PhpSpreadsheet/pull/2813)
44+
- Many fixes for Charts, especially, but not limited to, Scatter, Bubble, and Surface charts. [Issue #2762](https://github.com/PHPOffice/PhpSpreadsheet/issues/2762) [Issue #2299](https://github.com/PHPOffice/PhpSpreadsheet/issues/2299) [Issue #2700](https://github.com/PHPOffice/PhpSpreadsheet/issues/2700) [Issue #2817](https://github.com/PHPOffice/PhpSpreadsheet/issues/2817) [Issue #2763](https://github.com/PHPOffice/PhpSpreadsheet/issues/2763) [PR #2828](https://github.com/PHPOffice/PhpSpreadsheet/pull/2828) [PR #2841](https://github.com/PHPOffice/PhpSpreadsheet/pull/2841) [PR #2846](https://github.com/PHPOffice/PhpSpreadsheet/pull/2846) [PR #2852](https://github.com/PHPOffice/PhpSpreadsheet/pull/2852)
3245

3346
## 1.23.0 - 2022-04-24
3447

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,44 @@
1111
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
1212
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
1313

14+
## PHP version support
15+
16+
LTS: Support for PHP versions will only be maintained for a period of six months beyond the
17+
[end of life of that PHP version](https://www.php.net/eol.php).
18+
19+
Currently the required PHP minimum version is PHP __7.3__.
20+
21+
See the `composer.json` for other requirements.
22+
23+
## Installation
24+
25+
Use [composer](https://getcomposer.org) to install PhpSpreadsheet into your project:
26+
27+
```sh
28+
composer require phpoffice/phpspreadsheet
29+
```
30+
31+
If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as `php-fpm` or Apache's `mod_php`, then you might want to add the following to your `composer.json` before installing:
32+
```json lines
33+
{
34+
"require": {
35+
"phpoffice/phpspreadsheet": "^1.23"
36+
},
37+
"config": {
38+
"platform": {
39+
"php": "7.3"
40+
}
41+
}
42+
}
43+
```
44+
and then run
45+
```sh
46+
composer install
47+
```
48+
to ensure that the correct dependencies are retrieved to match your deployment environment.
49+
50+
See [CLI vs Application run-time](https://php.watch/articles/composer-platform-check) for more details.
51+
1452
## Documentation
1553

1654
Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).

docs/index.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ for details.
3030

3131
### PHP version support
3232

33-
Support for PHP versions will only be maintained for a period of six months beyond the
33+
LTS: Support for PHP versions will only be maintained for a period of six months beyond the
3434
[end of life of that PHP version](https://www.php.net/eol.php).
3535

36+
Currently the required PHP minimum version is PHP 7.3. The last PHP release was 7.3.33 on 6th December 2021, so PhpSpreadsheet will support PHP 7.3 until 6th June 2022.
37+
PHP 7.4 is officially [End of Life](https://www.php.net/supported-versions.php) on 28th November 2022, and PhpSpreadsheet will continue to support PHP 7.4 for six months after that date.
38+
39+
See the `composer.json` for other requirements.
40+
3641
## Installation
3742

3843
Use [composer](https://getcomposer.org) to install PhpSpreadsheet into your project:
@@ -47,6 +52,26 @@ Or also download the documentation and samples if you plan to use them:
4752
composer require phpoffice/phpspreadsheet --prefer-source
4853
```
4954

55+
If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as `php-fpm` or Apache's `mod_php`, then you might want to add the following to your `composer.json` before installing:
56+
```json lines
57+
{
58+
"require": {
59+
"phpoffice/phpspreadsheet": "^1.23"
60+
},
61+
"config": {
62+
"platform": {
63+
"php": "7.3"
64+
}
65+
}
66+
}
67+
```
68+
and then run
69+
```sh
70+
composer install
71+
```
72+
to ensure that the correct dependencies are retrieved to match your deployment environment.
73+
74+
See [CLI vs Application run-time](https://php.watch/articles/composer-platform-check) for more details.
5075

5176
## Hello World
5277

docs/references/features-cross-reference.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<th></th>
1717
<th>XLS</th>
1818
<th>XLSX</th>
19-
<th>Excel2003XML</th>
19+
<th>XML (Excel2003XML)</th>
2020
<th>Ods</th>
2121
<th>Gnumeric</th>
2222
<th>CSV</th>
@@ -732,12 +732,32 @@
732732
<td></td>
733733
<td></td>
734734
</tr>
735+
<tr>
736+
<td style="padding-left: 1em;">Hidden Worksheets</td>
737+
<td style="text-align: center; color: green;">✔</td>
738+
<td style="text-align: center; color: green;">✔</td>
739+
<td></td>
740+
<td style="text-align: center; color: green;">✔</td>
741+
<td style="text-align: center; color: green;">✔</td>
742+
<td style="text-align: center;">N/A</td>
743+
<td></td>
744+
<td></td>
745+
<td></td>
746+
<td></td>
747+
<td></td>
748+
<td></td>
749+
<td></td>
750+
<td></td>
751+
<td></td>
752+
<td></td>
753+
</tr>
735754
<tr>
736755
<td style="padding-left: 1em;">Coloured Tabs</td>
737756
<td></td>
738757
<td></td>
739758
<td></td>
740759
<td></td>
760+
<td></td>
741761
<td style="text-align: center;">N/A</td>
742762
<td></td>
743763
<td></td>

docs/topics/migration-from-PHPExcel.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,30 @@ in `src/`, you can run the migration like so:
1414

1515
```sh
1616
composer require rector/rector --dev
17-
vendor/bin/rector process src --set phpexcel-to-phpspreadsheet
18-
composer remove rector/rector
17+
18+
# this creates rector.php config
19+
vendor/bin/rector init
20+
```
21+
22+
Add `PHPOfficeSetList` set to `rector.php`
23+
24+
```php
25+
declare(strict_types=1);
26+
27+
use Rector\Config\RectorConfig;
28+
use Rector\PHPOffice\Set\PHPOfficeSetList;
29+
30+
return static function (RectorConfig $rectorConfig): void {
31+
$rectorConfig->sets([
32+
PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET
33+
]);
34+
};
35+
```
36+
37+
And run Rector on your code:
38+
39+
```sh
40+
vendor/bin/rector process src
1941
```
2042

2143
For more details, see

docs/topics/reading-and-writing-to-file.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ $spreadsheet = $reader->loadSpreadsheetFromString($data);
449449
#### Setting CSV options
450450

451451
Often, CSV files are not really "comma separated", or use semicolon (`;`)
452-
as a separator. You can instruct
453-
`\PhpOffice\PhpSpreadsheet\Reader\Csv` some options before reading a CSV
452+
as a separator. You can set some options before reading a CSV
454453
file.
455454

456455
The separator will be auto-detected, so in most cases it should not be necessary
@@ -506,6 +505,12 @@ $reader->setSheetIndex(0);
506505
$spreadsheet = $reader->load('sample.csv');
507506
```
508507

508+
The CSV reader will normally not load null strings into the spreadsheet.
509+
To load them:
510+
```php
511+
$reader->setPreserveNullString(true);
512+
```
513+
509514
Finally, you can set a callback to be invoked when the constructor is executed,
510515
either through `new Csv()` or `IOFactory::load`,
511516
and have that callback set the customizable attributes to whatever
@@ -584,8 +589,7 @@ $writer->save("05featuredemo.csv");
584589
#### Setting CSV options
585590

586591
Often, CSV files are not really "comma separated", or use semicolon (`;`)
587-
as a separator. You can instruct
588-
`\PhpOffice\PhpSpreadsheet\Writer\Csv` some options before writing a CSV
592+
as a separator. You can set some options before writing a CSV
589593
file:
590594

591595
```php

0 commit comments

Comments
 (0)