Hi all,
It seems conditional compilation is required for zip extension.
My system does not have zip_file_add, ZIP_FL_OVERWRITE in /usr/include/zip.h
libzip 0.11.2 has these, but zip_file_add() addition is not in NEWS file
somehow.
OS: Fedora19 x86_64
[yohgaki@dev php-src]$ rpm -q libzip-devel
libzip-devel-0.10.1-6.fc19.x86_64
cc -I/usr/lib64/libzip/include -Iext/zip/ -I/home/yohgaki/git/oss/
php.net/php-src/ext/zip/ -DPHP_ATOM_INC -I/home/yohgaki/git/oss/
php.net/php-src/include
-I/home/yohgaki/git/oss/php.net/php-src/main-I/home/yohgaki/git/oss/
php.net/php-src
-I/home/yohgaki/git/oss/php.net/php-src/ext/date/lib-I/home/yohgaki/git/oss/
php.net/php-src/ext/ereg/regex -I/usr/include/libxml2
-I/usr/include/enchant -I/usr/X11 -I/usr/include/freetype2
-I/usr/include/imap -I/usr/interbase/include -I/home/yohgaki/git/oss/
php.net/php-src/ext/mbstring/oniguruma -I/home/yohgaki/git/oss/
php.net/php-src/ext/mbstring/libmbfl -I/home/yohgaki/git/oss/
php.net/php-src/ext/mbstring/libmbfl/mbfl -I/usr/local/pgsql/include
-I/home/yohgaki/git/oss/php.net/php-src/ext/sqlite3/libsqlite-I/usr/include/pspell
-I/usr/local/include -I/home/yohgaki/git/oss/
php.net/php-src/TSRM
-I/home/yohgaki/git/oss/php.net/php-src/Zend-I/usr/include -g
-fvisibility=hidden -O0 -Wall -c /home/yohgaki/git/oss/
php.net/php-src/ext/zip/php_zip.c -fPIC -DPIC -o ext/zip/.libs/php_zip.o
/home/yohgaki/git/oss/php.net/php-src/ext/zip/php_zip.c: In function
'php_zip_add_file':
/home/yohgaki/git/oss/php.net/php-src/ext/zip/php_zip.c:339:2: warning:
implicit declaration of function 'zip_file_add'
[-Wimplicit-function-declaration]
if (zip_file_add(za, entry_name, zs, ZIP_FL_OVERWRITE) < 0) {
^
/home/yohgaki/git/oss/php.net/php-src/ext/zip/php_zip.c:339:39: error:
'ZIP_FL_OVERWRITE' undeclared (first use in this function)
if (zip_file_add(za, entry_name, zs, ZIP_FL_OVERWRITE) < 0) {
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Le 29/12/2013 04:11, Yasuo Ohgaki a écrit :
Hi all,
My system does not have zip_file_add, ZIP_FL_OVERWRITE in /usr/include/zip.h
libzip 0.11.2 has these, but zip_file_add() addition is not in NEWS file
somehow.
PHP 5.5 ext/zip (1.11) extension doesn't support use of system libzip
(possible with some patch and libzip 0.10 only )
PHP 5.6 ext/zip (1.12) extension now support use of system libzip, using
the --with-libzip option, but this requires libzip >= 0.11.
It seems conditional compilation is required for zip extension.
There are a lot of changes in libzip 0.11 which allow this, without
using any internal libzip API. So, libzip 0.10 can't be supported in any
way.
This is a reason why Fedora 20 official PHP packages have switch from
ext/zip to pecl/zip (it is easier to update the extension than php tree).
I'm working on pecl/zip 1.12.4 with libzip 0.11.2 (with 2 new methods)
and will merge it soon in 5.6 tree.
I will try to add some version check in the config.m4 to provide a more
explicit error message.
Remi.
HI Remi,
PHP 5.6 ext/zip (1.12) extension now support use of system libzip, using
the --with-libzip option, but this requires libzip >= 0.11.
Thank you for the explanation.
I'm using --with-libzip option. We need version check in config.m4, I
suppose.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Le 29/12/2013 04:11, Yasuo Ohgaki a écrit :
[yohgaki@dev php-src]$ rpm -q libzip-devel
libzip-devel-0.10.1-6.fc19.x86_64cc -I/usr/lib64/libzip/include -Iext/zip/ -I/home/yohgaki/git/oss/
php.net/php-src/ext/zip/ -DPHP_ATOM_INC -I/home/yohgaki/git/oss/
php.net/php-src/include
It seems ext/zip/lib is missing in the build option when using bundled
libzip. Which can explain some issue.
This is fix by
https://github.com/pierrejoye/php_zip/commit/4afaf1128200d44057e68d2bef3a9acbbd14b3e6
This will be applied soon in 5.6 branch.
Remi.