Clean up very obsolete links
This commit is contained in:
parent
ca6114639a
commit
4dd486fb94
43
docs/faq.md
43
docs/faq.md
|
@ -11,21 +11,11 @@ with PHP's `iconv()` or `mb_convert_encoding()` functions.
|
||||||
PhpSpreadsheet holds an "in memory" representation of a spreadsheet, so
|
PhpSpreadsheet holds an "in memory" representation of a spreadsheet, so
|
||||||
it is susceptible to PHP's memory limitations. The memory made available
|
it is susceptible to PHP's memory limitations. The memory made available
|
||||||
to PHP can be increased by editing the value of the `memory_limit`
|
to PHP can be increased by editing the value of the `memory_limit`
|
||||||
directive in your php.ini file, or by using
|
directive in your `php.ini` file, or by using
|
||||||
`ini_set('memory_limit', '128M')` within your code.
|
`ini_set('memory_limit', '128M')` within your code.
|
||||||
|
|
||||||
Some Readers and Writers are faster than others, and they also use
|
Some Readers and Writers are faster than others, and they also use
|
||||||
differing amounts of memory. You can find some indication of the
|
differing amounts of memory.
|
||||||
relative performance and memory usage for the different Readers and
|
|
||||||
Writers, over the different versions of PhpSpreadsheet, on the
|
|
||||||
[discussion
|
|
||||||
board](http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=234150).
|
|
||||||
|
|
||||||
If you've already increased memory to a maximum, or can't change your
|
|
||||||
memory limit, then [this
|
|
||||||
discussion](http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=242712)
|
|
||||||
on the board describes some of the methods that can be applied to reduce
|
|
||||||
the memory usage of your scripts using PhpSpreadsheet.
|
|
||||||
|
|
||||||
## Protection on my worksheet is not working?
|
## Protection on my worksheet is not working?
|
||||||
|
|
||||||
|
@ -65,32 +55,3 @@ file in Excel, the actual width is 0.71 less than it should be.
|
||||||
The short answer is that PhpSpreadsheet uses a measure where padding is
|
The short answer is that PhpSpreadsheet uses a measure where padding is
|
||||||
included. See [how to set a column's width](./topics/recipes.md#setting-a-columns-width)
|
included. See [how to set a column's width](./topics/recipes.md#setting-a-columns-width)
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
## How do I use PhpSpreadsheet with my framework
|
|
||||||
|
|
||||||
- There are some instructions for using PhpSpreadsheet with Joomla on
|
|
||||||
the [Joomla message
|
|
||||||
board](http://http:/forum.joomla.org/viewtopic.php?f=304&t=433060)
|
|
||||||
- A page of advice on using [PhpSpreadsheet in the Yii
|
|
||||||
framework](http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/)
|
|
||||||
- [The
|
|
||||||
Bakery](http://bakery.cakephp.org/articles/melgior/2010/01/26/simple-excel-spreadsheet-helper)
|
|
||||||
has some helper classes for reading and writing with PhpSpreadsheet
|
|
||||||
within CakePHP
|
|
||||||
- Integrating [PhpSpreadsheet into Kohana
|
|
||||||
3](http://www.flynsarmy.com/2010/07/phpexcel-module-for-kohana-3/)
|
|
||||||
and [Интеграция PHPExcel и Kohana
|
|
||||||
Framework](http://szpargalki.blogspot.com/2011/02/phpexcel-kohana-framework.html)
|
|
||||||
- Using [PhpSpreadsheet with
|
|
||||||
TYPO3](http://typo3.org/documentation/document-library/extension-manuals/phpexcel_library/1.1.1/view/toc/0/)
|
|
||||||
|
|
||||||
### Tutorials
|
|
||||||
|
|
||||||
- [English PHPExcel tutorial](http://openxmldeveloper.org)
|
|
||||||
- [French PHPExcel
|
|
||||||
tutorial](http://g-ernaelsten.developpez.com/tutoriels/excel2007/)
|
|
||||||
- [Russian PHPExcel Blog
|
|
||||||
Postings](http://www.web-junior.net/sozdanie-excel-fajjlov-s-pomoshhyu-phpexcel/)
|
|
||||||
- [A Japanese-language introduction to
|
|
||||||
PHPExcel](http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html)
|
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,8 @@ In Excel `+` wins over `&`, just like `*` wins over `+` in ordinary
|
||||||
algebra. The former rule is not what one finds using the calculation
|
algebra. The former rule is not what one finds using the calculation
|
||||||
engine shipped with PhpSpreadsheet.
|
engine shipped with PhpSpreadsheet.
|
||||||
|
|
||||||
Reference for operator precedence in Excel:
|
- [Reference for Excel](https://support.office.com/en-us/article/Calculation-operators-and-precedence-in-Excel-48be406d-4975-4d31-b2b8-7af9e0e2878a)
|
||||||
<http://support.microsoft.com/kb/25189>
|
- [Reference for PHP](http://php.net/manual/en/language.operators.php)
|
||||||
|
|
||||||
Reference for operator precedence in PHP: <http://www.php.net/operators>
|
|
||||||
|
|
||||||
#### Formulas involving numbers and text
|
#### Formulas involving numbers and text
|
||||||
|
|
||||||
|
@ -76,8 +74,7 @@ formula is evaluated as 3 instead of evaluating as an error. This also
|
||||||
causes the Excel document being generated as containing unreadable
|
causes the Excel document being generated as containing unreadable
|
||||||
content.
|
content.
|
||||||
|
|
||||||
Reference for this behaviour in PHP:
|
- [Reference for this behaviour in PHP](http://php.net/manual/en/language.types.string.php#language.types.string.conversion)
|
||||||
<http://php.net/manual/en/language.types.string.php#language.types.string.conversion>
|
|
||||||
|
|
||||||
#### Formulas don’t seem to be calculated in Excel2003 using compatibility pack?
|
#### Formulas don’t seem to be calculated in Excel2003 using compatibility pack?
|
||||||
|
|
||||||
|
|
|
@ -11,21 +11,18 @@ Currently, PhpSpreadsheet supports the following File Types for Reading:
|
||||||
### Xls
|
### Xls
|
||||||
|
|
||||||
The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary
|
The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary
|
||||||
file format that was used by Microsoft Excel™ between versions 95 and
|
file format that was used by Microsoft Excel™ between versions 95 and 2003.
|
||||||
2003. The format is supported (to various extents) by most spreadsheet
|
The format is supported (to various extents) by most spreadsheet
|
||||||
programs. BIFF files normally have an extension of .xls. Documentation
|
programs. BIFF files normally have an extension of .xls. Documentation
|
||||||
describing the format can be found online at
|
describing the format can be [read online](https://msdn.microsoft.com/en-us/library/cc313154(v=office.12).aspx)
|
||||||
<http://msdn.microsoft.com/en-us/library/cc313154(v=office.12).aspx> or
|
or [downloaded as PDF](http://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/%5BMS-XLS%5D.pdf).
|
||||||
from [as a downloadable
|
|
||||||
PDF](http://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/%5BMS-XLS%5D.pdf).
|
|
||||||
|
|
||||||
### Xml
|
### Xml
|
||||||
|
|
||||||
Microsoft Excel™ 2003 included options for a file format called
|
Microsoft Excel™ 2003 included options for a file format called
|
||||||
SpreadsheetML. This file is a zipped XML document. It is not very
|
SpreadsheetML. This file is a zipped XML document. It is not very
|
||||||
common, but its core features are supported. Documentation for the
|
common, but its core features are supported. Documentation for the
|
||||||
format can be found at
|
format can be [read online](https://msdn.microsoft.com/en-us/library/aa140066(office.10).aspx)
|
||||||
<http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx>
|
|
||||||
though it’s sadly rather sparse in its detail.
|
though it’s sadly rather sparse in its detail.
|
||||||
|
|
||||||
### Xlsx
|
### Xlsx
|
||||||
|
@ -35,23 +32,21 @@ Office Open XML SpreadsheetML, and Excel 2010 extended this still
|
||||||
further with its new features such as sparklines. These files typically
|
further with its new features such as sparklines. These files typically
|
||||||
have an extension of .xlsx. This format is based around a zipped
|
have an extension of .xlsx. This format is based around a zipped
|
||||||
collection of eXtensible Markup Language (XML) files. Microsoft Office
|
collection of eXtensible Markup Language (XML) files. Microsoft Office
|
||||||
Open XML SpreadsheetML is mostly standardized in ECMA 376
|
Open XML SpreadsheetML is mostly standardized in [ECMA 376](http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm)
|
||||||
(<http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm>)
|
|
||||||
and ISO 29500.
|
and ISO 29500.
|
||||||
|
|
||||||
### Ods
|
### Ods
|
||||||
|
|
||||||
aka Open Document Format (ODF) or OASIS, this is the OpenOffice.org XML
|
aka Open Document Format (ODF) or OASIS, this is the OpenOffice.org XML
|
||||||
File Format for spreadsheets. It comprises a zip archive including
|
file format for spreadsheets. It comprises a zip archive including
|
||||||
several components all of which are text files, most of these with
|
several components all of which are text files, most of these with
|
||||||
markup in the eXtensible Markup Language (XML). It is the standard file
|
markup in the eXtensible Markup Language (XML). It is the standard file
|
||||||
format for OpenOffice.org Calc and StarCalc, and files typically have an
|
format for OpenOffice.org Calc and StarCalc, and files typically have an
|
||||||
extension of .ods. The published specification for the file format is
|
extension of .ods. The published specification for the file format is
|
||||||
available from the OASIS Open Office XML Format Technical Committee web
|
available from [the OASIS Open Office XML Format Technical Committee web
|
||||||
page
|
page](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office).
|
||||||
(<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office#technical>).
|
Other information is available from [the OpenOffice.org XML File Format
|
||||||
Other information is available from the OpenOffice.org XML File Format
|
web page](http://www.openoffice.org/xml/), part of the
|
||||||
web page (<http://xml.openoffice.org/general.html>), part of the
|
|
||||||
OpenOffice.org project.
|
OpenOffice.org project.
|
||||||
|
|
||||||
### Slk
|
### Slk
|
||||||
|
@ -66,12 +61,12 @@ options (unlike CSV files).
|
||||||
|
|
||||||
### Gnumeric
|
### Gnumeric
|
||||||
|
|
||||||
The Gnumeric file format is used by the Gnome Gnumeric spreadsheet
|
The [Gnumeric file format](https://help.gnome.org/users/gnumeric/stable/sect-file-formats.html.en#file-format-gnumeric)
|
||||||
application, and typically files have an extension of .gnumeric. The
|
is used by the Gnome Gnumeric spreadsheet
|
||||||
|
application, and typically files have an extension of `.gnumeric`. The
|
||||||
file contents are stored using eXtensible Markup Language (XML) markup,
|
file contents are stored using eXtensible Markup Language (XML) markup,
|
||||||
and the file is then compressed using the GNU project's gzip compression
|
and the file is then compressed using the GNU project's gzip compression
|
||||||
library.
|
library.
|
||||||
<http://projects.gnome.org/gnumeric/doc/file-format-gnumeric.shtml>
|
|
||||||
|
|
||||||
### Csv
|
### Csv
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Useful links and tools
|
|
||||||
|
|
||||||
There are some links and tools which are very useful when developing
|
|
||||||
using PhpSpreadsheet.
|
|
||||||
|
|
||||||
## OpenXML / SpreadsheetML
|
|
||||||
|
|
||||||
- [File format
|
|
||||||
documentation](http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm)
|
|
||||||
- [OpenXML Explained
|
|
||||||
e-book](http://openxmldeveloper.org/articles/1970.aspx)
|
|
||||||
- [Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint
|
|
||||||
2007 File
|
|
||||||
Formats](http://www.microsoft.com/downloads/details.aspx?familyid=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en)
|
|
||||||
- [OpenXML Package Explorer](http://www.codeplex.com/PackageExplorer/)
|
|
|
@ -47,7 +47,7 @@ you to select the most appropriate implementation for your environnement. You
|
||||||
can either implement [PSR-16](http://www.php-fig.org/psr/psr-16/) from scratch,
|
can either implement [PSR-16](http://www.php-fig.org/psr/psr-16/) from scratch,
|
||||||
or use [pre-existing libraries](https://packagist.org/search/?q=psr-16).
|
or use [pre-existing libraries](https://packagist.org/search/?q=psr-16).
|
||||||
|
|
||||||
One such library is [PHP Cache](http://www.php-cache.com/) which
|
One such library is [PHP Cache](https://www.php-cache.com/) which
|
||||||
provides a wide range of alternatives. Refers to their documentation for
|
provides a wide range of alternatives. Refers to their documentation for
|
||||||
details, but here are a few suggestions that should get you started.
|
details, but here are a few suggestions that should get you started.
|
||||||
|
|
||||||
|
@ -105,4 +105,4 @@ $pool = new \Cache\Adapter\Memcache\MemcacheCachePool($client);
|
||||||
$simpleCache = new \Cache\Bridge\SimpleCache\SimpleCacheBridge($pool);
|
$simpleCache = new \Cache\Bridge\SimpleCache\SimpleCacheBridge($pool);
|
||||||
|
|
||||||
\PhpOffice\PhpSpreadsheet\Settings::setCache($simpleCache);
|
\PhpOffice\PhpSpreadsheet\Settings::setCache($simpleCache);
|
||||||
```
|
```
|
||||||
|
|
|
@ -4,15 +4,17 @@
|
||||||
|
|
||||||
XML-based formats such as OfficeOpen XML, Excel2003 XML, OASIS and
|
XML-based formats such as OfficeOpen XML, Excel2003 XML, OASIS and
|
||||||
Gnumeric are susceptible to XML External Entity Processing (XXE)
|
Gnumeric are susceptible to XML External Entity Processing (XXE)
|
||||||
injection attacks (for an explanation of XXE injection see
|
injection attacks when reading spreadsheet files. This can lead to:
|
||||||
http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html) when reading
|
|
||||||
spreadsheet files. This can lead to:
|
|
||||||
|
|
||||||
- Disclosure whether a file is existent
|
- Disclosure whether a file is existent
|
||||||
- Server Side Request Forgery
|
- Server Side Request Forgery
|
||||||
- Command Execution (depending on the installed PHP wrappers)
|
- Command Execution (depending on the installed PHP wrappers)
|
||||||
|
|
||||||
To prevent this, by default every XML-based Reader looks for XML entities declared inside the DOCTYPE and if any is found an exception is raised.
|
To prevent this, by default every XML-based Reader looks for XML
|
||||||
|
entities declared inside the DOCTYPE and if any is found an exception
|
||||||
|
is raised.
|
||||||
|
|
||||||
|
Read more [about of XXE injection](https://websec.io/2012/08/27/Preventing-XXE-in-PHP.html).
|
||||||
|
|
||||||
## Loading a Spreadsheet File
|
## Loading a Spreadsheet File
|
||||||
|
|
||||||
|
@ -566,16 +568,16 @@ CSV | YES | HTML | NO
|
||||||
When loading data from a file that contains no formatting information,
|
When loading data from a file that contains no formatting information,
|
||||||
such as a CSV file, then data is read either as strings or numbers
|
such as a CSV file, then data is read either as strings or numbers
|
||||||
(float or integer). This means that PhpSpreadsheet does not
|
(float or integer). This means that PhpSpreadsheet does not
|
||||||
automatically recognise dates/times (such as "16-Apr-2009" or "13:30"),
|
automatically recognise dates/times (such as `16-Apr-2009` or `13:30`),
|
||||||
booleans ("TRUE" or "FALSE"), percentages ("75%"), hyperlinks
|
booleans (`true` or `false`), percentages (`75%`), hyperlinks
|
||||||
("http://www.phpexcel.net"), etc as anything other than simple strings.
|
(`https://www.example.com`), etc as anything other than simple strings.
|
||||||
However, you can apply additional processing that is executed against
|
However, you can apply additional processing that is executed against
|
||||||
these values during the load process within a Value Binder.
|
these values during the load process within a Value Binder.
|
||||||
|
|
||||||
A Value Binder is a class that implement the
|
A Value Binder is a class that implement the
|
||||||
\PhpOffice\PhpSpreadsheet\Cell\IValueBinder interface. It must contain a
|
`\PhpOffice\PhpSpreadsheet\Cell\IValueBinder` interface. It must contain a
|
||||||
bindValue() method that accepts a `\PhpOffice\PhpSpreadsheet\Cell\Cell` and a
|
`bindValue()` method that accepts a `\PhpOffice\PhpSpreadsheet\Cell\Cell` and a
|
||||||
value as arguments, and return a boolean true or false that indicates
|
value as arguments, and return a boolean `true` or `false` that indicates
|
||||||
whether the workbook cell has been populated with the value or not. The
|
whether the workbook cell has been populated with the value or not. The
|
||||||
Advanced Value Binder implements such a class: amongst other tests, it
|
Advanced Value Binder implements such a class: amongst other tests, it
|
||||||
identifies a string comprising "TRUE" or "FALSE" (based on locale
|
identifies a string comprising "TRUE" or "FALSE" (based on locale
|
||||||
|
|
|
@ -275,7 +275,7 @@ You can make a cell a clickable URL by setting its hyperlink property:
|
||||||
|
|
||||||
``` php
|
``` php
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
|
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
|
||||||
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net');
|
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('https://www.example.com');
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to make a hyperlink to another worksheet/cell, use the
|
If you want to make a hyperlink to another worksheet/cell, use the
|
||||||
|
|
|
@ -22310,7 +22310,7 @@
|
||||||
<Cell ss:StyleID="ce16"/>
|
<Cell ss:StyleID="ce16"/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row ss:Height="13.4079">
|
<Row ss:Height="13.4079">
|
||||||
<Cell ss:MergeAcross="2" ss:HRef="http://www.phpexcel.net/" ss:StyleID="ce17">
|
<Cell ss:MergeAcross="2" ss:HRef="https://www.example.com/" ss:StyleID="ce17">
|
||||||
<Data ss:Type="String">PhpSpreadsheet</Data>
|
<Data ss:Type="String">PhpSpreadsheet</Data>
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell ss:Index="1024" ss:StyleID="ce13"/>
|
<Cell ss:Index="1024" ss:StyleID="ce13"/>
|
||||||
|
@ -39528,4 +39528,4 @@
|
||||||
</Table>
|
</Table>
|
||||||
<x:WorksheetOptions/>
|
<x:WorksheetOptions/>
|
||||||
</ss:Worksheet>
|
</ss:Worksheet>
|
||||||
</Workbook>
|
</Workbook>
|
||||||
|
|
Binary file not shown.
|
@ -246,7 +246,7 @@ $spreadsheet->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(Prote
|
||||||
// Add a hyperlink to the sheet
|
// Add a hyperlink to the sheet
|
||||||
$helper->log('Add a hyperlink to an external website');
|
$helper->log('Add a hyperlink to an external website');
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
|
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
|
||||||
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net');
|
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('https://www.example.com');
|
||||||
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website');
|
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website');
|
||||||
$spreadsheet->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);
|
$spreadsheet->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ class HyperlinkTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testGetUrl()
|
public function testGetUrl()
|
||||||
{
|
{
|
||||||
$urlValue = 'http://www.phpexcel.net';
|
$urlValue = 'https://www.example.com';
|
||||||
|
|
||||||
$testInstance = new Hyperlink($urlValue);
|
$testInstance = new Hyperlink($urlValue);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class HyperlinkTest extends TestCase
|
||||||
|
|
||||||
public function testSetUrl()
|
public function testSetUrl()
|
||||||
{
|
{
|
||||||
$initialUrlValue = 'http://www.phpexcel.net';
|
$initialUrlValue = 'https://www.example.com';
|
||||||
$newUrlValue = 'http://github.com/PHPOffice/PhpSpreadsheet';
|
$newUrlValue = 'http://github.com/PHPOffice/PhpSpreadsheet';
|
||||||
|
|
||||||
$testInstance = new Hyperlink($initialUrlValue);
|
$testInstance = new Hyperlink($initialUrlValue);
|
||||||
|
@ -55,7 +55,7 @@ class HyperlinkTest extends TestCase
|
||||||
|
|
||||||
public function testIsInternal()
|
public function testIsInternal()
|
||||||
{
|
{
|
||||||
$initialUrlValue = 'http://www.phpexcel.net';
|
$initialUrlValue = 'https://www.example.com';
|
||||||
$newUrlValue = 'sheet://Worksheet1!A1';
|
$newUrlValue = 'sheet://Worksheet1!A1';
|
||||||
|
|
||||||
$testInstance = new Hyperlink($initialUrlValue);
|
$testInstance = new Hyperlink($initialUrlValue);
|
||||||
|
@ -69,9 +69,9 @@ class HyperlinkTest extends TestCase
|
||||||
|
|
||||||
public function testGetHashCode()
|
public function testGetHashCode()
|
||||||
{
|
{
|
||||||
$urlValue = 'http://www.phpexcel.net';
|
$urlValue = 'https://www.example.com';
|
||||||
$tooltipValue = 'PhpSpreadsheet Web Site';
|
$tooltipValue = 'PhpSpreadsheet Web Site';
|
||||||
$initialExpectedHash = '6f1d4cbf40034b9ddc3fbf6019506e91';
|
$initialExpectedHash = '3a8d5a682dba27276dce538c39402437';
|
||||||
|
|
||||||
$testInstance = new Hyperlink($urlValue, $tooltipValue);
|
$testInstance = new Hyperlink($urlValue, $tooltipValue);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class OdsTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @var Spreadsheet
|
* @var Spreadsheet
|
||||||
*/
|
*/
|
||||||
private $spreadsheetOOCalcTest;
|
private $spreadsheetOdsTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Spreadsheet
|
* @var Spreadsheet
|
||||||
|
@ -26,17 +26,17 @@ class OdsTest extends TestCase
|
||||||
/**
|
/**
|
||||||
* @return Spreadsheet
|
* @return Spreadsheet
|
||||||
*/
|
*/
|
||||||
protected function loadOOCalcTestFile()
|
private function loadOdsTestFile()
|
||||||
{
|
{
|
||||||
if (!$this->spreadsheetOOCalcTest) {
|
if (!$this->spreadsheetOdsTest) {
|
||||||
$filename = __DIR__ . '/../../../samples/templates/OOCalcTest.ods';
|
$filename = __DIR__ . '/../../../samples/templates/OOCalcTest.ods';
|
||||||
|
|
||||||
// Load into this instance
|
// Load into this instance
|
||||||
$reader = new Ods();
|
$reader = new Ods();
|
||||||
$this->spreadsheetOOCalcTest = $reader->loadIntoExisting($filename, new Spreadsheet());
|
$this->spreadsheetOdsTest = $reader->loadIntoExisting($filename, new Spreadsheet());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->spreadsheetOOCalcTest;
|
return $this->spreadsheetOdsTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,7 +87,7 @@ class OdsTest extends TestCase
|
||||||
|
|
||||||
public function testReadValueAndComments()
|
public function testReadValueAndComments()
|
||||||
{
|
{
|
||||||
$spreadsheet = $this->loadOOCalcTestFile();
|
$spreadsheet = $this->loadOdsTestFile();
|
||||||
|
|
||||||
$firstSheet = $spreadsheet->getSheet(0);
|
$firstSheet = $spreadsheet->getSheet(0);
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ class OdsTest extends TestCase
|
||||||
|
|
||||||
public function testReadColors()
|
public function testReadColors()
|
||||||
{
|
{
|
||||||
$spreadsheet = $this->loadOOCalcTestFile();
|
$spreadsheet = $this->loadOdsTestFile();
|
||||||
$firstSheet = $spreadsheet->getSheet(0);
|
$firstSheet = $spreadsheet->getSheet(0);
|
||||||
|
|
||||||
// Background color
|
// Background color
|
||||||
|
@ -166,7 +166,7 @@ class OdsTest extends TestCase
|
||||||
|
|
||||||
public function testReadRichText()
|
public function testReadRichText()
|
||||||
{
|
{
|
||||||
$spreadsheet = $this->loadOOCalcTestFile();
|
$spreadsheet = $this->loadOdsTestFile();
|
||||||
$firstSheet = $spreadsheet->getSheet(0);
|
$firstSheet = $spreadsheet->getSheet(0);
|
||||||
|
|
||||||
self::assertEquals(
|
self::assertEquals(
|
||||||
|
@ -189,14 +189,14 @@ class OdsTest extends TestCase
|
||||||
|
|
||||||
public function testReadHyperlinks()
|
public function testReadHyperlinks()
|
||||||
{
|
{
|
||||||
$spreadsheet = $this->loadOOCalcTestFile();
|
$spreadsheet = $this->loadOdsTestFile();
|
||||||
$firstSheet = $spreadsheet->getSheet(0);
|
$firstSheet = $spreadsheet->getSheet(0);
|
||||||
|
|
||||||
$hyperlink = $firstSheet->getCell('A29');
|
$hyperlink = $firstSheet->getCell('A29');
|
||||||
|
|
||||||
self::assertEquals(DataType::TYPE_STRING, $hyperlink->getDataType());
|
self::assertEquals(DataType::TYPE_STRING, $hyperlink->getDataType());
|
||||||
self::assertEquals('PHPExcel', $hyperlink->getValue());
|
self::assertEquals('PhpSpreadsheet', $hyperlink->getValue());
|
||||||
self::assertEquals('http://www.phpexcel.net/', $hyperlink->getHyperlink()->getUrl());
|
self::assertEquals('https://github.com/PHPOffice/phpspreadsheet', $hyperlink->getHyperlink()->getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Below some test for features not implemented yet
|
// Below some test for features not implemented yet
|
||||||
|
@ -205,7 +205,7 @@ class OdsTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete('Features not implemented yet');
|
$this->markTestIncomplete('Features not implemented yet');
|
||||||
|
|
||||||
$spreadsheet = $this->loadOOCalcTestFile();
|
$spreadsheet = $this->loadOdsTestFile();
|
||||||
$firstSheet = $spreadsheet->getSheet(0);
|
$firstSheet = $spreadsheet->getSheet(0);
|
||||||
|
|
||||||
// Font styles
|
// Font styles
|
||||||
|
|
Loading…
Reference in New Issue