Over the years PclZip became a maintenance problem. It's code base
is old and the official project seems to have died out. ZipArchive
is now more commonly available and offer an easier and more complete
API. So PclZip was dropped in order to focus our efforts on what matters.
Closes#18
We need to make note of two things:
- The old code was trying to clone an objectArray, and hence was performing a shallow copy of memoryDrawing objects (the __clone magic function was not getting invoked).
Instead, if one loops over the objectArray, and then clones the individual memory drawing objects, then the __clone function for the MemoryDrawing object is invoked.
- The __clone function for memory drawing was using the clone keyword which does not deal with circular references (Since memoryDrawing object had references to worksheet object, it was encountering an infinite loop). However, serializing and unserializing objects deals with circular references pretty well.
Fixes#92Closes#106
By design, UTF-8 allows any byte-oriented substring searching algorithm,
since the sequence of bytes for a character cannot occur anywhere else
([source](https://en.wikipedia.org/wiki/UTF-8#Advantages_3)).
So `str_replace()` also works for UTF-8-encoded strings, assuming that
the input strings are valid UTF-8 strings. The previous implementation
of mbStrReplace() did nothing to detect invalid strings.
Also, `str_replace()` does not support [Unicode equivalence](https://en.wikipedia.org/wiki/Unicode_equivalence),
but nor do the other `mb_string` functions, and nor does `=SUBSTITUTE()` in Excel
(tested on Excel for Mac version 15.19.1, Excel 2016 for Windows and LibreOffice 5.1).
Closes#109
Because alignment was all broken and becaues it doesn't improve much
the code readability, but potentially create more complicated diff, we
prefer to unlaign all docblocks.
Third party PDF libraries must now be installed via composer and naturally
via composer autoloading mechanism. Because of that it is not necessary
to specify their path on disk. The usage is simplified and it allows us
to include them in our unit tests.
This also means that from now on PhpSpreadsheet must use composer autoloader
mechanism. The internal autoloading implementation was dropped.
The OOXML spec defines the font sizes (the `sz` element) as a double, so the value needs to be wrapped in `PHPExcel_Shared_String::FormatNumber()` to avoid breaking in non-English locales.
`RichText` tries to extract container cell's font via
`Cell->getParent()->getStyle(...)`, which crashes because
`getParent()` does not return a worksheet. Changing it to
`getWorksheet()` fixes the problem.
If $a or $b are not strings, you can get an error that fmod needs param 1 ($a) to be of type double.
MS Excel does not fall over when you insert an empty string in MOD, so I'm guessing PHPExcel should do the same?
For (still) unknown reasons, PHPExcel detects a wrong field type.
If there is no BSE Index, we will fail here and other fields are not read.
So if the BSE Index < 1, continue with the next field.
TODO: Why is there no BSE Index?
Is this a new Office Version?
Password protected field?
More likely : a uncompatible picture
PHP Notice: Undefined offset: -1 in Classes/PHPExcel/Reader/Excel5.php on line 1063
PHP Fatal error: Call to a member function getBlipType() on a non-object in Classes/PHPExcel/Reader/Excel5.php on line 1064
removeColumn doesn't remove all cells, because CacheBase::deleteCacheData only unsets cell data if they are objects.
But cached cell data could be arrays.
I moved the unset from inside the if block (line 150 ff) to after the if block.
BaseReader called `isValidFormat` despite it doesn't require it to be
implemented. Instead we replaced `isValidFormat` by a proper implementation
of `canRead` in each classes. This also remove the semantic amibguity between
those two methods.
FIX#32
This is to fix the situation when cells merged vertically are ignored in columns auto size calculations.
I also removed $calculateMergeCells param as it wasn't used and I believe the only situation when you
want to calculate the width of merged columns has been covered here (and there's no reason to not calculate it).
FIX#46
Some references to classes were incorrectly assumed to be a reference
to self, whereas they were references to classes in global namespace
outside of this project.
FIX#37
GD is implicitly required for saving images anyway, this exception when
it's not loaded simply gives more information on what to do if the
execution flow reaches a places that depends on a function from GD.
```php
<?php
$array = array(
'str' => 'foo',
'num' => 12345,
'null' => NULL,
);
print intval(isset($array['null'])) . PHP_EOL;
print intval(array_key_exists($array['null'])) . PHP_EOL;
print intval(isset($array['num'])) . PHP_EOL;
print intval(array_key_exists($array['num'])) . PHP_EOL;
print intval(isset($array['str'])) . PHP_EOL;
print intval(array_key_exists($array['str'])) . PHP_EOL;
```
Only for this special case, you need array_key_exists(), else avoid it as it is
painfully slow and hurts your performance.
Signed-off-by: Roland Häder <roland@mxchange.org>
Remove the term "hack" from the source code to prevent it
from being flagged by malware scanners and audit tools (such as
the very popular myJoomla.com for Joomla sites)
Remove the term "hacked by" from the source code to prevent it
from being flagged by malware scanners and audit tools (such as
the very popular myJoomla.com for Joomla sites)
If a sheet name included an apostrophe and the sheet had print area
defined then the spreadsheet could not be saved because the cell
coordinates were mangled, eg:
'Fiche d''action'!$A$1:$N$19
wrongly became:
'Fiche d'$A$1:$N$19
This introduce a helper class that should be used to log things,
avoiding a lot of boilerplate code.
Also all output are made in /tmp folder instead of beside the script
itself. This is because there is a high chance that the folder containing
the script is not writtable by webserver. So using the /tmp folder
makes it more likely to works in a variety of setup.
Yii framework v1.1 has it's own autoloader and its autoloader throws
an error, when it can't find class. When this library initializes, it
register its own autoloader, but places it at the end of autoload
queue. So when I use library with Yii 1.1, I just face an error:
`include(PHPExcel_Shared_String.php): failed to open stream: No such file or directory`
because Yii's autoloader runs first and tries to include class file
directly.
Registering our autoloader first avoid this.