NOTE: drops php5 support for PHP extension (thrift_protocol)
however library still can support PHP5 as evidenced by CI build
Client: php
This closes#1385
This closes#1391
The thrift build system currently assumes that the thrift compiler is
always available in $(top_builddir)/compiler/cpp/thrift. However, in a
cross-compilation context, this location contains the thrift compiler
built for the target... which obviously will not run on the build
machine.
In order to support such cross-compilation situation, we introduce the
THRIFT variable as a an argument for the configure script (using
AC_ARG_VAR). If not specified, it defaults to the existing value of
using compiler/cpp/thrift from the build directory, but it can be
overridden when calling ./configure.
Note that $(top_builddir) cannot be used within the configure script,
so we simply use `pwd`, which is the same as the top_builddir.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This closes#1336
This closes#1350
Client: php
Exceptions thrown through PHPExceptionWrapper are prematurely freed at the end
of the catch block, even though zend_throw_exception_object expects to take
ownership of the value.
Ensure we free return_value in case of exceptions
Patch: Håkon Hitland <hakon.hitland@zedge.net>
Patch: Roy Sindre Norangshol <norangshol@zedge.net>
This closes#1314
The PHP 7 extension can sometimes free strings it does not own,
when serializing string map keys, or the name of called methods.
The latter case was somewhat migitated since the double-free has no
effect on interned strings.
Using ZVAL_STR_COPY instead of ZVAL_STR will increment the reference
count, making the following destructor call correct.
Fix memory leak in PHP 7
Fix memory leak when deserializing maps or sets.
zend_hash_update will add its own reference to the key, so we need to
destruct the key zval to not leak.
We don't need to destruct the value, the hash table will take ownership
of it.
This closes#1152
This is an initial port of php_thrift_protocol to PHP7. However as
we deal with zval's all over the place, we opt for separating
the C files completely leading to some overhead. However this
is a good start to see the differences in the implementation. From
there we should follow up with a more unified approach by refactoring
parts of the zval handling to be more generic so we can plug it
into PHP 7 and PHP 5 extensions.
Tested this by running with TestClient.php against a CPP server
and using TBinaryProtocolAccelerated.
The file lib/php/lib/Thrift/Type/TConstant.php is missing from the php
Makefile. Therefore "make install" don't copy the TConstant.php file.
This closes#689
Client: C_glib, C++, D, Erlang, Go, Haskell, Lua, Java/Me, JavaScript, Node, Ocaml, Perl, PHP, Python, Ruby
Patch: Jens Geyer
This closes#341
Minimal server-side implementations and TODO stubs for various languages to let "make check" succeeed.
Not contained in this patch and still TODO:
- client side implementations, i.e. calls to testBinary() and appropriate tests
- server side hex printout missing for some languages
This patch adds a "json" option to PHP code generation that will
make generated classes implement JsonSerializable, so thrift
objects may be converted to json using json_encode() easily.
If the "validate" option is enabled, the object's write validator
will be called, beyond that the jsonSerialize() method only outputs
non-null fields in the JSON object (JSON parsers get grumpy if you
send them null where they expect to see a number).
Patch: Stig Bakken
Github Pull Request: This closes#219
Client: PHP
Patch: GitHub-User anjz <anartzn@gmail.com>
This closes#212
Removed `strrev` from `readDouble` and `writeDouble` functions. I found problems reading a double that was generated with the python library.