Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
22319315
Commit
22319315
authored
May 10, 2017
by
Paul Yang
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix c extension for php7.1. (#3077)
parent
c2154e12
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
25 deletions
+98
-25
Dockerfile
jenkins/docker/Dockerfile
+14
-1
Dockerfile
jenkins/docker32/Dockerfile
+39
-24
message.c
php/ext/google/protobuf/message.c
+8
-0
tests.sh
tests.sh
+37
-0
No files found.
jenkins/docker/Dockerfile
View file @
22319315
...
...
@@ -164,6 +164,14 @@ RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php
RUN
cd
php-7.0.18
&&
make clean
&&
./configure
--prefix
=
/usr/local/php-7.0
&&
\
make
&&
make
install
&&
cd
..
RUN
wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror
RUN
mv
mirror php-7.1.4.tar.bz2
RUN
tar
-xvf
php-7.1.4.tar.bz2
RUN
cd
php-7.1.4
&&
./configure
--enable-maintainer-zts
--prefix
=
/usr/local/php-7.1-zts
&&
\
make
&&
make
install
&&
cd
..
RUN
cd
php-7.1.4
&&
make clean
&&
./configure
--prefix
=
/usr/local/php-7.1
&&
\
make
&&
make
install
&&
cd
..
RUN
php
-r
"copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN
php composer-setup.php
RUN
mv
composer.phar /usr/bin/composer
...
...
@@ -190,7 +198,12 @@ RUN cd /tmp && \
ln
-sfn
/usr/local/php-7.0/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-7.0/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-7.0
mv
vendor /usr/local/vendor-7.0
&&
\
ln
-sfn
/usr/local/php-7.1/bin/php /usr/bin/php
&&
\
ln
-sfn
/usr/local/php-7.1/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-7.1/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-7.1
##################
# Go dependencies.
...
...
jenkins/docker32/Dockerfile
View file @
22319315
...
...
@@ -57,30 +57,6 @@ RUN apt-get clean && apt-get update && apt-get install -y --force-yes \
##################
# PHP dependencies.
RUN
php
-r
"copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN
php composer-setup.php
RUN
mv
composer.phar /usr/bin/composer
RUN
php
-r
"unlink('composer-setup.php');"
RUN
cd
/tmp
&&
\
git clone https://github.com/google/protobuf.git
&&
\
cd
protobuf/php
&&
\
git reset
--hard
6b27c1f981a9a93918e4039f236ead27165a8e91
&&
\
ln
-sfn
/usr/bin/php5.5 /usr/bin/php
&&
\
ln
-sfn
/usr/bin/php-config5.5 /usr/bin/php-config
&&
\
ln
-sfn
/usr/bin/phpize5.5 /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-5.5
&&
\
ln
-sfn
/usr/bin/php5.6 /usr/bin/php
&&
\
ln
-sfn
/usr/bin/php-config5.6 /usr/bin/php-config
&&
\
ln
-sfn
/usr/bin/phpize5.6 /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-5.6
&&
\
ln
-sfn
/usr/bin/php7.0 /usr/bin/php
&&
\
ln
-sfn
/usr/bin/php-config7.0 /usr/bin/php-config
&&
\
ln
-sfn
/usr/bin/phpize7.0 /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-7.0
RUN
wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror
RUN
mv
mirror php-5.5.38.tar.bz2
RUN
tar
-xvf
php-5.5.38.tar.bz2
...
...
@@ -105,6 +81,45 @@ RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php
RUN
cd
php-7.0.18
&&
make clean
&&
./configure
--enable-bcmath
--prefix
=
/usr/local/php-7.0
&&
\
make
&&
make
install
&&
cd
..
RUN
wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror
RUN
mv
mirror php-7.1.4.tar.bz2
RUN
tar
-xvf
php-7.1.4.tar.bz2
RUN
cd
php-7.1.4
&&
./configure
--enable-maintainer-zts
--prefix
=
/usr/local/php-7.1-zts
&&
\
make
&&
make
install
&&
cd
..
RUN
cd
php-7.1.4
&&
make clean
&&
./configure
--enable-bcmath
--prefix
=
/usr/local/php-7.1
&&
\
make
&&
make
install
&&
cd
..
RUN
php
-r
"copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN
php composer-setup.php
RUN
mv
composer.phar /usr/bin/composer
RUN
php
-r
"unlink('composer-setup.php');"
RUN
composer config
-g
--
disable-tls
true
RUN
composer config
-g
--
secure-http
false
RUN
cd
/tmp
&&
\
git clone https://github.com/google/protobuf.git
&&
\
cd
protobuf/php
&&
\
git reset
--hard
6b27c1f981a9a93918e4039f236ead27165a8e91
&&
\
ln
-sfn
/usr/local/php-5.5/bin/php /usr/bin/php
&&
\
ln
-sfn
/usr/local/php-5.5/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-5.5/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-5.5
&&
\
ln
-sfn
/usr/local/php-5.6/bin/php /usr/bin/php
&&
\
ln
-sfn
/usr/local/php-5.6/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-5.6/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-5.6
&&
\
ln
-sfn
/usr/local/php-7.0/bin/php /usr/bin/php
&&
\
ln
-sfn
/usr/local/php-7.0/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-7.0/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-7.0
&&
\
ln
-sfn
/usr/local/php-7.1/bin/php /usr/bin/php
&&
\
ln
-sfn
/usr/local/php-7.1/bin/php-config /usr/bin/php-config
&&
\
ln
-sfn
/usr/local/php-7.1/bin/phpize /usr/bin/phpize
&&
\
composer
install
&&
\
mv
vendor /usr/local/vendor-7.1
##################
# Python dependencies
...
...
php/ext/google/protobuf/message.c
View file @
22319315
...
...
@@ -116,7 +116,11 @@ static void message_set_property(zval* object, zval* member, zval* value,
return
;
}
#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
if
(
Z_OBJCE_P
(
object
)
!=
EG
(
scope
))
{
#else
if
(
Z_OBJCE_P
(
object
)
!=
zend_get_executed_scope
())
{
#endif
// User cannot set property directly (e.g., $m->a = 1)
zend_error
(
E_USER_ERROR
,
"Cannot access private property."
);
return
;
...
...
@@ -146,7 +150,11 @@ static zval* message_get_property(zval* object, zval* member, int type,
return
PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL
;
}
#if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
if
(
Z_OBJCE_P
(
object
)
!=
EG
(
scope
))
{
#else
if
(
Z_OBJCE_P
(
object
)
!=
zend_get_executed_scope
())
{
#endif
// User cannot get property directly (e.g., $a = $m->a)
zend_error
(
E_USER_ERROR
,
"Cannot access private property."
);
return
PHP_PROTO_GLOBAL_UNINITIALIZED_ZVAL
;
...
...
tests.sh
View file @
22319315
...
...
@@ -545,16 +545,51 @@ build_php7.0_mac() {
popd
}
build_php7.1
()
{
use_php 7.1
pushd
php
rm
-rf
vendor
cp
-r
/usr/local/vendor-7.1 vendor
wget https://phar.phpunit.de/phpunit-5.6.0.phar
-O
/usr/bin/phpunit
phpunit
popd
pushd
conformance
# TODO(teboring): Add it back
# make test_php
popd
}
build_php7.1_c
()
{
use_php 7.1
wget https://phar.phpunit.de/phpunit-5.6.0.phar
-O
/usr/bin/phpunit
cd
php/tests
&&
/bin/bash ./test.sh
&&
cd
../..
pushd
conformance
# make test_php_c
popd
}
build_php7.1_zts_c
()
{
use_php_zts 7.1
wget https://phar.phpunit.de/phpunit-5.6.0.phar
-O
/usr/bin/phpunit
cd
php/tests
&&
/bin/bash ./test.sh
&&
cd
../..
pushd
conformance
# make test_php_c
popd
}
build_php_all
()
{
build_php5.5
build_php5.6
build_php7.0
build_php7.1
build_php5.5_c
build_php5.6_c
build_php7.0_c
build_php7.1_c
build_php5.5_zts_c
build_php5.6_zts_c
build_php7.0_zts_c
build_php7.1_zts_c
}
# Note: travis currently does not support testing more than one language so the
...
...
@@ -595,6 +630,8 @@ Usage: $0 { cpp |
php5.6_c |
php7.0 |
php7.0_c |
php7.1 |
php7.1_c |
php_all)
"
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment