THRIFT-3046: Allow PSR4 class loading for generated classes (PHP)
Allow test to be used with psr4 autoloading
This closes #1010
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index 946334d..2443ee0 100755
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -15,7 +15,11 @@
$loader = new ThriftClassLoader();
$loader->registerNamespace('Thrift', __DIR__ . '/../../lib/php/lib');
-$loader->registerDefinition('ThriftTest', $GEN_DIR);
+if ($GEN_DIR === 'gen-php-psr4') {
+ $loader->registerNamespace('ThriftTest', $GEN_DIR);
+} else {
+ $loader->registerDefinition('ThriftTest', $GEN_DIR);
+}
$loader->register();
/*