Commit Graph

105 Commits

Author SHA1 Message Date
Bryan Duxbury
ded25bbe0d THRIFT-941. php: Make PHP C Extension use the defined Protocol writeMessageBegin function
This patch causes the C extension to call into user-land to get the correct writeMessageBegin function.

Patch: Chris Goffinet

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004864 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 00:23:30 +00:00
David Reiss
653eadab2f THRIFT-841. Exclude generated php and erlang Makefiles from "make dist"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1004509 13f79535-47bb-0310-9956-ffa450edef68
2010-10-05 02:38:58 +00:00
Bryan Duxbury
89200e1c9d THRIFT-854. php: Provide configure option and make rules to build/install php extension
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
2010-08-25 17:09:02 +00:00
Bryan Duxbury
184d26237a THRIFT-851. php: php extension fails to compile on centos 5.x
This patch introduces an approach that is compatbile with both centos and Mac.

Patch: Todd Lipcon

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@986410 13f79535-47bb-0310-9956-ffa450edef68
2010-08-17 17:43:58 +00:00
Bryan Duxbury
7b1128c94f THRIFT-682. php: PHP extension doesn't compile on Mac OS X
This patch adds a bswap_64 implementation for OS X users.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-13 00:17:16 +00:00
David Reiss
cf8fc15fa0 THRIFT-837. php: Fix accelerator bug affecting writes > 8k
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985038 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:27:54 +00:00
Bryan Duxbury
17115d7a52 THRIFT-778. php: PHP socket listening server
This patch which adds TServerTransport/TServerSocket, along with a generic TServer and TSimpleServer implementation.

Patch: Nick Jones

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984864 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 16:59:19 +00:00
Bryan Duxbury
7c74d9bfb1 THRIFT-780. php: Prevent aborts due to simultaneous exceptions
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
2010-08-12 15:00:41 +00:00
Bryan Duxbury
b149bc7050 THRIFT-718. php: Thrift PHP library includes closing tags and extraneous whitespace
This patch trims closing tags to avoid potential for whitespace.

Patch: Nicholas Telford

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984811 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 14:54:33 +00:00
David Reiss
1873fed342 THRIFT-647. php: Add license header and fix style in Makefile.am
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
2010-05-04 16:32:33 +00:00
Bryan Duxbury
6a68187338 THRIFT-647. php: PHP library is missing install target
This patch adds a 'make install' target to a new PHP makefile. 

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940325 13f79535-47bb-0310-9956-ffa450edef68
2010-05-02 22:39:31 +00:00
David Reiss
eb598b8c89 THRIFT-755. php: Fix compilation as a static module
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@934036 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 17:33:01 +00:00
David Reiss
006260f07a THRIFT-659. php: Make php_thrift_protocol handle std::exception cleanly
Any std::exceptions thrown from within the extension will now be
converted into php exceptions.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920662 13f79535-47bb-0310-9956-ffa450edef68
2010-03-09 05:19:20 +00:00
David Reiss
3bb5e0581a THRIFT-683. Remove profanity
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@902941 13f79535-47bb-0310-9956-ffa450edef68
2010-01-25 19:31:31 +00:00
David Reiss
70c89d4ae0 THRIFT-350. php: Fix the extension build when C++ is not already used
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@793630 13f79535-47bb-0310-9956-ffa450edef68
2009-07-13 17:21:03 +00:00
Bryan Duxbury
af3b6309b5 THRIFT-349. php: Accelerated binary protocol serialization segementation fault
Check to make sure that the object being serialized has a valid struct spec, error otherwise.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@773976 13f79535-47bb-0310-9956-ffa450edef68
2009-05-12 16:53:23 +00:00
Bryan Duxbury
c2a9245d25 THRIFT-499. php: Thrift_protocol PHP extension does not handle signedness correctly
Cast all the number types to signed values before making PHP longs out of them.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@773974 13f79535-47bb-0310-9956-ffa450edef68
2009-05-12 16:44:52 +00:00
Bryan Duxbury
def30a6072 THRIFT-387. Add appropriate Apache header to all code files
This hits all the documentation and some misc code files that have avoided the license up to this point.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763048 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 00:19:37 +00:00
David Reiss
deda141392 THRIFT-388. Create a "ONEWAY" message type that is an alias for "CALL"
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
2009-04-02 19:22:31 +00:00
David Reiss
887bd33772 Remove obsolete php extension tag
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760218 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 22:52:39 +00:00
David Reiss
f82aee5087 THRIFT-387. Add license statements to some autoconf macro files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760216 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 22:52:29 +00:00
David Reiss
ea2cba8ba8 THRIFT-387. Add license headers to a bunch of files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760189 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 21:35:00 +00:00
David Reiss
be648eee8c THRIFT-404. php: Make TPhpStream work for cli (cgi) scripts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758526 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 06:14:45 +00:00
David Reiss
5ab303c165 php: Improve some docblock comments for TSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758516 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 04:27:47 +00:00
Bryan Duxbury
13083d6d52 THRIFT-294. Remove @author tags
They're gone. Don't add any new ones!



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756307 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 02:19:46 +00:00
David Reiss
a9ea68b907 Make the PHP generator dynamic.
- 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
2009-02-17 20:28:24 +00:00
Mark Slee
fc8a1e0469 THRIFT-169: Fixes framed/buffered transport state on underlying flush failure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@704710 13f79535-47bb-0310-9956-ffa450edef68
2008-10-14 22:00:36 +00:00
David Reiss
1f5ce50186 THRIFT-99. php: Add scheme (http[s], etc.) support to THttpClient
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@680211 13f79535-47bb-0310-9956-ffa450edef68
2008-07-27 23:41:13 +00:00
David Reiss
1931b12be0 php: Fix an undefined variasble in an error message
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@677698 13f79535-47bb-0310-9956-ffa450edef68
2008-07-17 19:36:34 +00:00
dweatherford
e4dc4f5366 [thrift] Propogate exceptions from transports in thrift_protocol extension
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
2008-04-11 02:51:44 +00:00
dweatherford
0b8a382c00 [thrift] Error checking for T_OBJECT serialization
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
2008-03-25 03:15:10 +00:00
dweatherford
840ca085fc [thrift] php thrift_protocol crash fixes
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
2008-03-08 05:51:24 +00:00
dweatherford
9b945da3ca [thrift] ZTS fixes for thift_protocol extension
Summary: Now the threadsafe build compiles!
Reviewed by: mcslee
Test Plan: compiles, ship it
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665558 13f79535-47bb-0310-9956-ffa450edef68
2008-03-06 03:11:08 +00:00
lucas
f8f21e769e restore tags/1.0.0, we need these at least until fb9 is rolled everywhere
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-05 22:04:13 +00:00
dweatherford
cf997a45c6 [thrift] PHP thrift_protocol extension, revision 2.0
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
2008-03-04 01:08:23 +00:00
eletuchy
260a5fa08e [thrift] grrrr ... TPhpStream can read the string '0'
Summary: php sucks

    Reviewed By: mcslee

    Test Plan: thrift call with string '0' has same behavior as string '1'

    Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665477 13f79535-47bb-0310-9956-ffa450edef68
2008-02-13 22:41:03 +00:00
David Reiss
0c90f6f8af Thrift: Whitespace cleanup.
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
2008-02-06 22:18:40 +00:00
Mark Slee
97264864df is_a is deprecated, instanceof only takes vars or constants
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
2007-12-20 03:23:27 +00:00
David Reiss
bef54c0647 Thrift: Fix a backwards change.
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
2007-11-28 20:15:11 +00:00
Mark Slee
d0f5b28835 Fix typo in Thrift trunk
Summary: $classl => $class


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665376 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 04:29:25 +00:00
Mark Slee
e02ab33cb8 Lowercase autoload strings
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
2007-11-28 04:17:49 +00:00
Mark Slee
645ecea714 Kill fast binary compliance in TBase, it doesn't work
Reviewed By: akhil

Test Plan: Regenerate code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665374 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 02:46:24 +00:00
Mark Slee
276eea68b7 Add (int) case to Thrift version comparison
Summary: Deals with 32 bit machines doing a weird sign-bit thing here.

Reviewed By: dreiss

Test Plan: For 32 bit AmieStreet partners


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665356 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 02:06:47 +00:00
hzhao
b6014f494f added trunk
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665352 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:54:30 +00:00
hzhao
7fcc9e87ba tagging thrift-protocol-1.0.0
Reviewed By: shire
Test Plan: ape work


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665351 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 20:48:56 +00:00
Mark Slee
09f69e0524 Add __autoload() support to Thrift-generated PHP code
Summary: Include thrift/autoload.php and use -phpa flag to generated code that works with autoload. Good for services with lots of methods that are typically not all invoked.

Reviewed By: dreiss

Test Plan: Falcon, baby, falcon.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665349 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:32:36 +00:00
Mark Slee
f5a6b0c109 Fix PHP TBufferedTransport readAll() to work with TSocket timeouts
Reviewed By: lucas

Test Plan: Invoke Buffered Transport wrapped around socket


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665348 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 00:27:17 +00:00
dweatherford
611434992a [thrift] Fix extension deserialization call with no classname
Summary: The extension expects a classname as a string and does not allow null;
  use the empty string instead of null in the absence of a classname to pass.

Reviewed By: mcslee
Test Plan: php -l
Revert: svn


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665347 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 03:29:47 +00:00
David Reiss
465ccc0924 Thrift: Fix new-style generated PHP code.
Summary:
Fix reading of lists/sets of lists/sets/maps.

Reviewed By: mcslee

Test Plan: Tested in trunk.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665333 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 21:41:29 +00:00
Mark Slee
0cdc6c8cd9 Merging PHP transport changes from www trunk to thrift trunk
Summary: Some empty() fixes, plus a few other socket helpers

Reviewed By: lucas

Test Plan: Use the transports to make IPC calls!


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665331 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 10:19:08 +00:00