Commit Graph
443 Commits
Author SHA1 Message Date
xiaoxiali(李晓夏) cf3333f008 fix 2020-09-16 19:53:53 +08:00
xiaoxiali 26348e5558 fix the annotation 2020-08-27 11:24:28 +08:00
xiaoxiali 59343bae91 fix by PHP-CS-Fixer 2020-08-21 14:51:02 +08:00
feline 74357ffb71 Update .travis.yml
update
2020-08-21 14:24:43 +08:00
feline 3279c09e71 Update Sheet.php
add the set and get function of the merge ranging
2020-07-20 14:37:51 +08:00
feline 094c34a60c Update WorksheetManager.php
fix the space
2020-07-20 14:33:16 +08:00
feline 1730b75cc6 Update WorksheetManager.php
fix the merging cells problem
2020-07-20 14:32:43 +08:00
madflow ab973cab34 use existing base folder 2019-12-19 23:24:24 +01:00
madflow b8eb2bb814 error_reporting set to -1 2019-12-16 13:42:24 +01:00
madflow f54f7a400c add PHP 7.4 2019-12-16 13:42:24 +01:00
Adrien Loison 7964dadc21 Add support for cells in error when writing XLSX and ODS
When appending data to an existing sheet, it was possible to get cells in error when reading (DIV/0 for instance). When trying to write them back, `addRow` would throw because `Cell`s in error were not supported by the writers.
v3.1.0
2019-12-02 22:21:41 +01:00
drowe eb88bb4c3a Automated native_function_invocation fixes 2019-11-18 12:17:27 +01:00
madflow 94b654175c disable no_superfluous_phpdoc_tags 2019-11-18 11:20:20 +01:00
Adrien Loison dbdf5f7f38 [ODS] Add support for whitespaces inside <text:span>
The `<text:p>` node can contain the string value directly or contain child elements. In this case, whitespaces contain in the child elements should be replaced by their XML equivalent:
 - space => `<text:s />`
 - tab => `<text:tab />`
 - line break => `<text:line-break />`

@see https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415200_253892949
2019-10-27 20:14:51 +01:00
Adrien Loison 9f4c094fa0 Cell alignment
This PR adds support for cell alignment for XLSX and ODS files.
You can now align the content of the cells this way:
```
use Box\Spout\Common\Entity\Style\CellAlignment;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;

$style = (new StyleBuilder())
    ->setCellAlignment(CellAlignment::RIGHT)
    ->build();
...
```

Possible cell alignments are: LEFT, RIGHT, CENTER and JUSTIFY.
2019-10-27 18:58:56 +01:00
Adrien Loison 0a0b1f7196 [docs] Fix site_url - take 2 2019-10-17 13:12:40 +00:00
Adrien Loison db32a7c7db [docs] Fix site_url 2019-10-17 11:15:55 +00:00
Adrien Loison 859b8d336e [Docs] Force using current protocol scheme for resources and links
If the docs is accessed with https, change all links to be https as well.
2019-10-17 10:32:39 +00:00
Adrien Loison 8a2dcc946b Improve docs for local dev 2019-10-17 09:29:03 +00:00
Adrien Loison 74146c6224 Switch documentation site to HTTPS
Accessing the website through HTTP may be blocked in some regions of the world.
Using HTTPS should help with this problem and is the good thing to do anyway.
2019-10-17 07:44:13 +00:00
Adrien Loison 6a6d1df9df Fix typo - Boder => Border 2019-10-17 07:37:37 +00:00
Alexander Rakushin 52312b7045 Added tests for StyleRegistry and StyleMerger 2019-10-01 20:08:54 +00:00
Alexander Rakushin d4e12b1812 Simplification of the code 2019-10-01 20:08:54 +00:00
Alexander Rakushin e8c6d83104 сode formatting (CS Fixer) 2019-10-01 20:08:54 +00:00
Alexander Rakushin 40aecd7b90 Added support for cell formats when writing Excel files 2019-10-01 20:08:54 +00:00
Adrien Loison 16a2f91a22 Cell indexes not being respected when rendering row
Fixes #682
When calling `Row::setCellIndex`, it's possible to create a Row with holes.
Instead of iterating over existing cells of a Row, we should instead use the cell indexes (from 0 to max cell index).
2019-09-28 14:02:23 +00:00
Ilya Troy 2d297e954b Update getting-started.md
Fix writer usage example
2019-07-30 22:14:20 +02:00
Adrien Loison 2716d7eeed [PHP 7.4] Updated way to disable the fgetcsv/fputcsv escape character
From PHP 7.4, the recommended way to disable the escape character for fgetcsv() and fputcsv() is an empty string, instead of "\0".
Discussed here: https://github.com/php/php-src/pull/3515
2019-07-21 23:15:34 +02:00
Adrien Loison 1bbfd45b82 Support for missing styles XML file in XLSX
Some files don't have a "styles.xml" file. Excel supports these files, Spout should do too.
2019-07-20 16:48:51 +02:00
Adrien Loison 6c4086cf97 Fix reading of 1904 dates option
Whether the spreadsheet is using 1904 dates or not is controlled by a XML property. Its value can be the string "false" that is not mapped to the boolean "false" but to the boolean "true"... Therefore Spout was previously using the wrong date system when this property was set.
v3.0.1
2019-06-04 09:36:51 +02:00
Adrien Loison a296f73a98 Fix Github icon in docs 2019-05-24 10:12:35 +02:00
Adrien Loison 0f0bf64802 Merge branch 'master' into develop_3.0 v3.0.0 2019-05-24 09:30:41 +02:00
Adrien Loison 9d33fcdd00 Update FAQ 2019-05-24 09:24:34 +02:00
Adrien Loison 4ff9717b0a Update FAQ in docs 2019-05-23 09:00:46 +02:00
Adrien Loison c62177f0e4 Move documentation from gh-pages branch to 'docs' folder
To prepare the migration to 3.0, we need to change the location where the documentation is generated from.
Having a gh-pages branch makes it hard to synchronize the code and the docs. Having a "docs" folder in the repo itself simplifies this.
2019-05-22 09:45:45 +02:00
Adrien Loison 3beaa32021 Fix docblock 2019-05-21 19:43:54 +02:00
Adrien Loison 5ce5a488d1 Force UTF-8 encoding in htmlspecialchars 2019-05-21 19:37:09 +02:00
Adrien Loison 69b0fb9eaf Add methods to SheetInterface
The SheetInterface was missing methods common to all Sheets (getIndex, getName, isActive, isVisible).
2019-05-17 21:38:29 +02:00
Adrien Loison 40ee386edd Add helper functions to create specific readers and writers
Removed the `ReaderEntityFactory::createReader(Type)` method and replaced it by 3 methods:
- `ReaderEntityFactory::createCSVReader()`
- `ReaderEntityFactory::createXLSXReader()`
- `ReaderEntityFactory::createODSReader()`

This has the advantage of enabling autocomplete in the IDE, as the return type is no longer the interface but the concrete type. Since readers may expose different options, this is pretty useful.

Similarly, removed the `WriterEntityFactory::createWriter(Type)` method and replaced it by 3 methods:
- `WriterEntityFactory::createCSVWriter()`
- `WriterEntityFactory::createXLSXWriter()`
- `WriterEntityFactory::createODSWriter()`

Since this is a breaking change, I also updated the Upgrade guide.
Finally, the doc is up to date too.
2019-05-17 21:22:03 +02:00
Adrien Loison 6104d41857 Add tests runs on PHP 7.3 in Travis 2019-05-17 13:37:25 +02:00
Adrien Loison 4260c46b11 Update documentation for 3.0 2019-05-17 13:25:49 +02:00
Adrien Loison 4a9d0398ad Update Reader/WriterEntityFactory
Add `WriterEntityFactory::createWriterFromFile`, working like `ReaderEntityFactory::createReaderFromFile` (guessing writer type from file name).
Use static functions when needed.
2019-05-17 13:22:27 +02:00
madflow e8693834a0 perf tests in development branch 2019-03-24 22:53:28 +01:00
Adrien Loison 171a2fab10 Fix test failure message 2019-02-02 09:55:16 +01:00
madflow 3d577197d2 upgrade guide 2019-01-30 16:01:25 +01:00
Adrien Loison 71cf0fe339 Fix sheet name escaping
Sheet names are stored as attributes of an XML entity. We therefore need a different escaping strategy, escaping quotes.
2019-01-26 16:14:15 +01:00
Adrien Loison ee998f7173 For PHP 7.1 for Composer
If local PHP is 7.2, we still want to download dependencies compatible with PHP 7.1
2019-01-04 19:24:28 +01:00
madflow 6c8344c025 PHP version in readme 2019-01-04 19:23:27 +01:00
Yannick ROGER a420e3fffa Fix phpunit (#604)
* Enforce PHP 5.4 on composer update
* Ran composer update
2018-12-03 16:42:00 +01:00
madflow e99c80b3ad create a reader by file type #569 2018-10-23 13:33:39 +02:00