matomo-org / component-decompress

Decompress files
GNU Lesser General Public License v3.0
12 stars 12 forks source link

PHP 7 compatibility #4

Closed tsteur closed 8 years ago

tsteur commented 9 years ago

refs piwik/piwik#8689

The pear/tar and PclZip dependencies are not PHP 7 compatible. Got the following notices:

vagrant@piwik-trusty64:~/www/piwik$ ./console development:sync-system-test-processed  15174
WARNING [2015-09-03 14:34:05] /home/vagrant/www/piwik/vendor/pear/pear-core-minimal/src/PEAR.php(87): Deprecated - Methods with the same name as their class will not be constructors in a future version of PHP; PEAR has a deprecated constructor - Piwik 2.15.0-b4 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2015-09-03 14:34:05] /home/vagrant/www/piwik/vendor/pear/pear-core-minimal/src/PEAR.php(796): Deprecated - Methods with the same name as their class will not be constructors in a future version of PHP; PEAR_Error has a deprecated constructor - Piwik 2.15.0-b4 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

Latest archive_tar lib should be PHP 7 compatible see https://pear.php.net/package/Archive_Tar/download/ but it's not fully. We need to wait for 1.14.1 release I presume.

PclZip seems to be already PHP 7 compatible but when I copy the new file of this lib I get the following error meaning it is maybe not done by updating the lib, we need to adjust code (or latest PclZip is buggy):

1) Tests\Piwik\Decompress\PclZipTest::testRelativePath
function_exists() expects parameter 1 to be string, object given

/home/vagrant/www/component-decompress/libs/PclZip/pclzip.lib.php:1720
/home/vagrant/www/component-decompress/libs/PclZip/pclzip.lib.php:737
/home/vagrant/www/component-decompress/src/PclZip.php:69
/home/vagrant/www/component-decompress/tests/PclZipTest.php:21
mattab commented 8 years ago

@tsteur It looks like Pear Tar 1.4.0 release adds PHP7 support.

tsteur commented 8 years ago

The fix is available for a while I think but there was a problem with it not being available in composer etc. It may now be as easy as updating composer

mattab commented 8 years ago

@tsteur I'm surprised this repository does not have a composer.lock - should it maybe have one? without composer.lock, how can we make sure to use a given version of Pear_Tar?

tsteur commented 8 years ago

I don't know. I haven't created the repo AFAIK. It should be committed when someone is working on it the next time