Client: PHP
Patch: Stig Bakken & Jens Geyer
Modifications made to the original pull request:
- moved TestValidators.* to lib/php/test
- created new TestValidators.thrift to house the UnionOfStrings union
- modified makefiles accordingly
This closes#159
Client: build process
Patch: jfarrell
Add check for php extension to not build if phpize has not been run,
update Vagrantfile to update package list for haskell test deps, and
change bison min version to 2.4 to work with the current versions of
debian, ubuntu and centos.
Client: php
Patch: Tyler Hobbs
Resolves the issue by importing TBinaryProtocolAccelerated and checking if $this->output_ is an instance of that instead of using a static string in TProtocol.
Client: php
Patch: Bryan Alves
Fixes issue with php overloaded mbstring to be binary-safe for strlen and substr.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1207960 13f79535-47bb-0310-9956-ffa450edef68
Client : php
Patch: Nick Jones
The THttpClient class ensures the $uri_ property has a slash prefixed by appending one if needed in the constructor. However in THttpClient::read, there are 2 exceptions thrown where a slash is concatenated between the port and uri. This results in a superfluous slash in the TTransportException message.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1185723 13f79535-47bb-0310-9956-ffa450edef68
client: php
Patch: Dave Watson
Previously the code incorrectly ignored unknown field types. After
reading the field header, if it was an unknown type it would incorrectly
assume there was no data, and start trying to read the next field
immediately.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1179907 13f79535-47bb-0310-9956-ffa450edef68
Client: php
Patch: Marimuthu Ponnambalam
Simple Serialization errors out, due to the TBufferTransport not flushing the data into TMemoryBuffer after $object->write($protocol) in TBinarySerializer.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1161968 13f79535-47bb-0310-9956-ffa450edef68
This patch makes sure that filling the php extension's internal buffer does not cause a premature flush of the whole transport.
Patch: Nathaniel Cook
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1141668 13f79535-47bb-0310-9956-ffa450edef68
Adds a nice TBinarySerializer class to make it simple to convert between PHP objects and serialized strings using the Binary protocol.
Patch: Radu Marin
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1021521 13f79535-47bb-0310-9956-ffa450edef68
This patch adds a make target in lib/php that builds the php extension. By default configure will attempt to build this, but it can be disabled with --without-php_extension.
Patch: Anthony Molinaro
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@989226 13f79535-47bb-0310-9956-ffa450edef68
The bug was triggered when flush() threw an exception in the
PHPOutputTransport destructor.
The PHPOutputTransport in thrift_protocol_write_binary() wasn't
constructed inside of the try block, so exceptions thrown when it was
auto-flushing in the destructor were calling terminate().
Move the transport construction inside of the try block, and add an
explicit flush before the transport is destroyed (since throwing an
exception from a destructor is generally a bad thing).
Patch: David Reiss
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984815 13f79535-47bb-0310-9956-ffa450edef68
The attachment was made with the "licensed for inclusion" option, so it
should get a standard Apache license header. Our other makefiles use
$() style for variables and don't include extra spaces before
backslashes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940936 13f79535-47bb-0310-9956-ffa450edef68
Pave the way for a new message type for oneway function calls.
For now, just define the constant in all languages and make
server implementations treat it the same way as a normal call.
Only C++ and Erlang currently check the message type (on the
server side).
There is a little bit of redundancy in the Erlang code, but
the alternative is a bit gross, and this split-up will be
necessary eventually when we start handling one-way calls
differently.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761389 13f79535-47bb-0310-9956-ffa450edef68
- Modify the PHP generator constructor to fit the new generic interface.
- Register the PHP genrator with the central registry.
- Deprecate the old way of invoking the PHP generator.
- main.cc no longer includes t_php_generator.h.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745238 13f79535-47bb-0310-9956-ffa450edef68
Summary: Otherwise, it will spin forever if your socket connection gets dropped
or otherwise times out.
Reviewed by: dbraginsky
Test plan: Modified TSocket to always throw an exception on read() and tried
some service calls
Revert: svn
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665652 13f79535-47bb-0310-9956-ffa450edef68
Summary: Avoid segfaulting via calling zend_fetch_class_entry on something
that might not actually be an object; throw an exception instead.
Reviewed by: shire
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665581 13f79535-47bb-0310-9956-ffa450edef68
Summary: The convert_to_*_ex functions were being used improperly resulting
in heap corruption in some cases; I just switched everything over to the
non-ex versions since it shouldn't matter if I modify the value being
serialized in place to coerce it to the proper type.
Also fixed a potential crash for map, set, and list types when not passed
an array, by first attempting an array conversion and then throwing a
tprotocolexception if that doesn't succeed. (Actually, PHP might fatal there
instead, it wasn't immediately clear from reading the code if that would
be the case).
Reviewed by: marcel
Test plan: Ran under php-5.2.5, debug and release builds. No more heap corruption
or memory leak complaints (the latter also a side effect of undesired zval
reference separation).
Revert: only if you love SIGSEGV
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665566 13f79535-47bb-0310-9956-ffa450edef68
Summary:
All PHP serialization and deserialization can now happen in extension-land,
which should be much faster. This includes reading message headers and all
complex types (structs, exceptions, whatever).
The compiler has been updated to always emit the $_TSPEC static array for
generated PHP code, since the new extension depends on it.
As before, the PHP code gates enabling the accelerated serialization on
the protocol being an instance of TBinaryProtocolAcclerated and the function
for the [de]serialization operation existing.
The function names have changed since the last version of the extension,
so old and new generated code can coexist, and new generated code can run on
a server with the old extension (but it will not use accelerated serialization).
Reviewed by: hzhao
Test Plan: Generated a couple of endpoints and called their services through the
new extension. Both use a variety of nested complex types. Built and ran the
extension in php-5.2.3 in debug mode, killed the reported memory leaks.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665548 13f79535-47bb-0310-9956-ffa450edef68
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.
Reviewed By: mcslee
Test Plan: git diff -b
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
Summary: Solution, dummy static class var to use instanceof
Reviewed By: dweatherford
Test Plan: Regen'd some mobile code in trunk using this
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665401 13f79535-47bb-0310-9956-ffa450edef68
Summary:
Got it right in trunk, but wrong in thrift.
Blame Rev: 69504
Reviewed By: mcslee
Test Plan:
Tested in trunk AND did a diff with trunk.
Revert Plan: ok
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665378 13f79535-47bb-0310-9956-ffa450edef68
Summary: PHP is undebatably the worst programming language in the world. Class names are case insensitive, so new $tHiNg = new $THing. Garbase. Now autoload has to deal with the fallout.
Reviewed By: dreiss
Test Plan: autoload enabled falcon code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665375 13f79535-47bb-0310-9956-ffa450edef68