Thrift PHP generation Redux
Summary: Chopping the amount of code generated by Thrift for PHP services by two orders of magnitude (approx 25% of the previous size). This is done via putting more logic in a dynamic base class and taking it out of the generated code. Hopefully this wins back the CPU cycles paid just to load code from APC at the cost of a marginal increase in dynamic execution runtime.
Reviewed By: sgrimm, dreiss
Test Plan: Ran all the tests in trunk/test/php, also tested the API generate code and Falcon, etc. in my sandbox
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665328 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/php/Makefile b/test/php/Makefile
index 57c621c..6cc5233 100644
--- a/test/php/Makefile
+++ b/test/php/Makefile
@@ -1,5 +1,5 @@
# Makefile for Thrift test project.
-#
+#
# Author:
# Mark Slee <mcslee@facebook.com>
@@ -16,7 +16,7 @@
inline: stubs-inline
stubs: ../ThriftTest.thrift
- $(THRIFT) --php ../ThriftTest.thrift
+ $(THRIFT) --phpl ../ThriftTest.thrift
stubs-inline: ../ThriftTest.thrift
$(THRIFT) --phpi ../ThriftTest.thrift
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index 07068e4..a508512 100644
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -22,10 +22,18 @@
/** Include the socket layer */
require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php';
+echo '==============================='."\n";
+echo ' SAFE TO IGNORE THESE IN TEST'."\n";
+echo '==============================='."\n";
+
/** Include the generated code */
require_once $GEN_DIR.'/ThriftTest.php';
require_once $GEN_DIR.'/ThriftTest_types.php';
+echo '==============================='."\n";
+echo ' END OF SAFE ERRORS SECTION'."\n";
+echo '==============================='."\n\n";
+
$host = 'localhost';
$port = 9090;
@@ -70,7 +78,7 @@
print_r("testString(\"Test\")");
$s = $testClient->testString("Test");
print_r(" = \"$s\"\n");
-
+
/**
* BYTE TEST
*/
@@ -296,7 +304,7 @@
}
}
print_r("}, ");
-
+
$xtructs = $v2->xtructs;
print_r("{");
if (is_array($xtructs)) {
@@ -306,7 +314,7 @@
}
}
print_r("}");
-
+
print_r("}, ");
}
print_r("}, ");