THRIFT-4459: reduce php library directory depth
Client: php

This closes #1471
diff --git a/composer.json b/composer.json
index c14dd99..af0135d 100644
--- a/composer.json
+++ b/composer.json
@@ -22,10 +22,10 @@
         "phpunit/phpunit": "~4.8.36"
     },
     "autoload": {
-        "psr-4": {"Thrift\\": "lib/php/lib/Thrift/"}
+        "psr-4": {"Thrift\\": "lib/php/lib/"}
     },
     "autoload-dev": {
-        "psr-4": {"Test\\Thrift\\": "lib/php/test/Test/Thrift/"}
+        "psr-4": {"Test\\Thrift\\": "lib/php/test/"}
     },
     "minimum-stability": "dev",
     "extra": {
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
index 5aa3be4..8d9050a 100755
--- a/lib/php/Makefile.am
+++ b/lib/php/Makefile.am
@@ -37,96 +37,96 @@
 
 endif
 
-phpdir = $(PHP_PREFIX)/Thrift
+phpdir = $(PHP_PREFIX)/
 php_DATA = \
-  lib/Thrift/TMultiplexedProcessor.php
+  lib/TMultiplexedProcessor.php
 
 phpbasedir = $(phpdir)/Base
 phpbase_DATA = \
-  lib/Thrift/Base/TBase.php
+  lib/Base/TBase.php
 
 phpclassloaderdir = $(phpdir)/ClassLoader
 phpclassloader_DATA = \
-  lib/Thrift/ClassLoader/ThriftClassLoader.php
+  lib/ClassLoader/ThriftClassLoader.php
 
 phpexceptiondir = $(phpdir)/Exception
 phpexception_DATA = \
-  lib/Thrift/Exception/TApplicationException.php \
-  lib/Thrift/Exception/TException.php \
-  lib/Thrift/Exception/TProtocolException.php \
-  lib/Thrift/Exception/TTransportException.php
+  lib/Exception/TApplicationException.php \
+  lib/Exception/TException.php \
+  lib/Exception/TProtocolException.php \
+  lib/Exception/TTransportException.php
 
 phpfactorydir = $(phpdir)/Factory
 phpfactory_DATA = \
-  lib/Thrift/Factory/TBinaryProtocolFactory.php \
-  lib/Thrift/Factory/TCompactProtocolFactory.php \
-  lib/Thrift/Factory/TJSONProtocolFactory.php \
-  lib/Thrift/Factory/TProtocolFactory.php \
-  lib/Thrift/Factory/TStringFuncFactory.php \
-  lib/Thrift/Factory/TTransportFactory.php
+  lib/Factory/TBinaryProtocolFactory.php \
+  lib/Factory/TCompactProtocolFactory.php \
+  lib/Factory/TJSONProtocolFactory.php \
+  lib/Factory/TProtocolFactory.php \
+  lib/Factory/TStringFuncFactory.php \
+  lib/Factory/TTransportFactory.php
 
 phpprotocoldir = $(phpdir)/Protocol
 phpprotocol_DATA = \
-  lib/Thrift/Protocol/TBinaryProtocolAccelerated.php \
-  lib/Thrift/Protocol/TBinaryProtocol.php \
-  lib/Thrift/Protocol/TCompactProtocol.php \
-  lib/Thrift/Protocol/TJSONProtocol.php \
-  lib/Thrift/Protocol/TMultiplexedProtocol.php \
-  lib/Thrift/Protocol/TProtocol.php \
-  lib/Thrift/Protocol/TProtocolDecorator.php \
-  lib/Thrift/Protocol/TSimpleJSONProtocol.php
+  lib/Protocol/TBinaryProtocolAccelerated.php \
+  lib/Protocol/TBinaryProtocol.php \
+  lib/Protocol/TCompactProtocol.php \
+  lib/Protocol/TJSONProtocol.php \
+  lib/Protocol/TMultiplexedProtocol.php \
+  lib/Protocol/TProtocol.php \
+  lib/Protocol/TProtocolDecorator.php \
+  lib/Protocol/TSimpleJSONProtocol.php
 
 phpprotocoljsondir = $(phpprotocoldir)/JSON
 phpprotocoljson_DATA = \
-  lib/Thrift/Protocol/JSON/BaseContext.php \
-  lib/Thrift/Protocol/JSON/ListContext.php \
-  lib/Thrift/Protocol/JSON/LookaheadReader.php \
-  lib/Thrift/Protocol/JSON/PairContext.php
+  lib/Protocol/JSON/BaseContext.php \
+  lib/Protocol/JSON/ListContext.php \
+  lib/Protocol/JSON/LookaheadReader.php \
+  lib/Protocol/JSON/PairContext.php
 
 phpprotocolsimplejsondir = $(phpprotocoldir)/SimpleJSON
 phpprotocolsimplejson_DATA = \
-  lib/Thrift/Protocol/SimpleJSON/CollectionMapKeyException.php \
-  lib/Thrift/Protocol/SimpleJSON/Context.php \
-  lib/Thrift/Protocol/SimpleJSON/ListContext.php \
-  lib/Thrift/Protocol/SimpleJSON/MapContext.php \
-  lib/Thrift/Protocol/SimpleJSON/StructContext.php
+  lib/Protocol/SimpleJSON/CollectionMapKeyException.php \
+  lib/Protocol/SimpleJSON/Context.php \
+  lib/Protocol/SimpleJSON/ListContext.php \
+  lib/Protocol/SimpleJSON/MapContext.php \
+  lib/Protocol/SimpleJSON/StructContext.php
 
 phpserializerdir = $(phpdir)/Serializer
 phpserializer_DATA = \
-  lib/Thrift/Serializer/TBinarySerializer.php
+  lib/Serializer/TBinarySerializer.php
 
 phpserverdir = $(phpdir)/Server
 phpserver_DATA = \
-  lib/Thrift/Server/TServerSocket.php \
-  lib/Thrift/Server/TForkingServer.php \
-  lib/Thrift/Server/TServer.php \
-  lib/Thrift/Server/TServerTransport.php \
-  lib/Thrift/Server/TSimpleServer.php
+  lib/Server/TServerSocket.php \
+  lib/Server/TForkingServer.php \
+  lib/Server/TServer.php \
+  lib/Server/TServerTransport.php \
+  lib/Server/TSimpleServer.php
 
 phpstringfuncdir = $(phpdir)/StringFunc
 phpstringfunc_DATA = \
-  lib/Thrift/StringFunc/Mbstring.php \
-  lib/Thrift/StringFunc/Core.php \
-  lib/Thrift/StringFunc/TStringFunc.php
+  lib/StringFunc/Mbstring.php \
+  lib/StringFunc/Core.php \
+  lib/StringFunc/TStringFunc.php
 
 phptransportdir = $(phpdir)/Transport
 phptransport_DATA = \
-  lib/Thrift/Transport/TBufferedTransport.php \
-  lib/Thrift/Transport/TCurlClient.php \
-  lib/Thrift/Transport/TFramedTransport.php \
-  lib/Thrift/Transport/THttpClient.php \
-  lib/Thrift/Transport/TMemoryBuffer.php \
-  lib/Thrift/Transport/TNullTransport.php \
-  lib/Thrift/Transport/TPhpStream.php \
-  lib/Thrift/Transport/TSocket.php \
-  lib/Thrift/Transport/TSocketPool.php \
-  lib/Thrift/Transport/TTransport.php
+  lib/Transport/TBufferedTransport.php \
+  lib/Transport/TCurlClient.php \
+  lib/Transport/TFramedTransport.php \
+  lib/Transport/THttpClient.php \
+  lib/Transport/TMemoryBuffer.php \
+  lib/Transport/TNullTransport.php \
+  lib/Transport/TPhpStream.php \
+  lib/Transport/TSocket.php \
+  lib/Transport/TSocketPool.php \
+  lib/Transport/TTransport.php
 
 phptypedir = $(phpdir)/Type
 phptype_DATA = \
-  lib/Thrift/Type/TMessageType.php \
-  lib/Thrift/Type/TType.php \
-  lib/Thrift/Type/TConstant.php
+  lib/Type/TMessageType.php \
+  lib/Type/TType.php \
+  lib/Type/TConstant.php
 
 EXTRA_DIST = \
   lib \
diff --git a/lib/php/lib/Thrift/Base/TBase.php b/lib/php/lib/Base/TBase.php
similarity index 100%
rename from lib/php/lib/Thrift/Base/TBase.php
rename to lib/php/lib/Base/TBase.php
diff --git a/lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php b/lib/php/lib/ClassLoader/ThriftClassLoader.php
similarity index 100%
rename from lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php
rename to lib/php/lib/ClassLoader/ThriftClassLoader.php
diff --git a/lib/php/lib/Thrift/Exception/TApplicationException.php b/lib/php/lib/Exception/TApplicationException.php
similarity index 100%
rename from lib/php/lib/Thrift/Exception/TApplicationException.php
rename to lib/php/lib/Exception/TApplicationException.php
diff --git a/lib/php/lib/Thrift/Exception/TException.php b/lib/php/lib/Exception/TException.php
similarity index 100%
rename from lib/php/lib/Thrift/Exception/TException.php
rename to lib/php/lib/Exception/TException.php
diff --git a/lib/php/lib/Thrift/Exception/TProtocolException.php b/lib/php/lib/Exception/TProtocolException.php
similarity index 100%
rename from lib/php/lib/Thrift/Exception/TProtocolException.php
rename to lib/php/lib/Exception/TProtocolException.php
diff --git a/lib/php/lib/Thrift/Exception/TTransportException.php b/lib/php/lib/Exception/TTransportException.php
similarity index 100%
rename from lib/php/lib/Thrift/Exception/TTransportException.php
rename to lib/php/lib/Exception/TTransportException.php
diff --git a/lib/php/lib/Thrift/Factory/TBinaryProtocolFactory.php b/lib/php/lib/Factory/TBinaryProtocolFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TBinaryProtocolFactory.php
rename to lib/php/lib/Factory/TBinaryProtocolFactory.php
diff --git a/lib/php/lib/Thrift/Factory/TCompactProtocolFactory.php b/lib/php/lib/Factory/TCompactProtocolFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TCompactProtocolFactory.php
rename to lib/php/lib/Factory/TCompactProtocolFactory.php
diff --git a/lib/php/lib/Thrift/Factory/TJSONProtocolFactory.php b/lib/php/lib/Factory/TJSONProtocolFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TJSONProtocolFactory.php
rename to lib/php/lib/Factory/TJSONProtocolFactory.php
diff --git a/lib/php/lib/Thrift/Factory/TProtocolFactory.php b/lib/php/lib/Factory/TProtocolFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TProtocolFactory.php
rename to lib/php/lib/Factory/TProtocolFactory.php
diff --git a/lib/php/lib/Thrift/Factory/TStringFuncFactory.php b/lib/php/lib/Factory/TStringFuncFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TStringFuncFactory.php
rename to lib/php/lib/Factory/TStringFuncFactory.php
diff --git a/lib/php/lib/Thrift/Factory/TTransportFactory.php b/lib/php/lib/Factory/TTransportFactory.php
similarity index 100%
rename from lib/php/lib/Thrift/Factory/TTransportFactory.php
rename to lib/php/lib/Factory/TTransportFactory.php
diff --git a/lib/php/lib/Thrift/Protocol/JSON/BaseContext.php b/lib/php/lib/Protocol/JSON/BaseContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/JSON/BaseContext.php
rename to lib/php/lib/Protocol/JSON/BaseContext.php
diff --git a/lib/php/lib/Thrift/Protocol/JSON/ListContext.php b/lib/php/lib/Protocol/JSON/ListContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/JSON/ListContext.php
rename to lib/php/lib/Protocol/JSON/ListContext.php
diff --git a/lib/php/lib/Thrift/Protocol/JSON/LookaheadReader.php b/lib/php/lib/Protocol/JSON/LookaheadReader.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/JSON/LookaheadReader.php
rename to lib/php/lib/Protocol/JSON/LookaheadReader.php
diff --git a/lib/php/lib/Thrift/Protocol/JSON/PairContext.php b/lib/php/lib/Protocol/JSON/PairContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/JSON/PairContext.php
rename to lib/php/lib/Protocol/JSON/PairContext.php
diff --git a/lib/php/lib/Thrift/Protocol/SimpleJSON/CollectionMapKeyException.php b/lib/php/lib/Protocol/SimpleJSON/CollectionMapKeyException.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/SimpleJSON/CollectionMapKeyException.php
rename to lib/php/lib/Protocol/SimpleJSON/CollectionMapKeyException.php
diff --git a/lib/php/lib/Thrift/Protocol/SimpleJSON/Context.php b/lib/php/lib/Protocol/SimpleJSON/Context.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/SimpleJSON/Context.php
rename to lib/php/lib/Protocol/SimpleJSON/Context.php
diff --git a/lib/php/lib/Thrift/Protocol/SimpleJSON/ListContext.php b/lib/php/lib/Protocol/SimpleJSON/ListContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/SimpleJSON/ListContext.php
rename to lib/php/lib/Protocol/SimpleJSON/ListContext.php
diff --git a/lib/php/lib/Thrift/Protocol/SimpleJSON/MapContext.php b/lib/php/lib/Protocol/SimpleJSON/MapContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/SimpleJSON/MapContext.php
rename to lib/php/lib/Protocol/SimpleJSON/MapContext.php
diff --git a/lib/php/lib/Thrift/Protocol/SimpleJSON/StructContext.php b/lib/php/lib/Protocol/SimpleJSON/StructContext.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/SimpleJSON/StructContext.php
rename to lib/php/lib/Protocol/SimpleJSON/StructContext.php
diff --git a/lib/php/lib/Thrift/Protocol/TBinaryProtocol.php b/lib/php/lib/Protocol/TBinaryProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TBinaryProtocol.php
rename to lib/php/lib/Protocol/TBinaryProtocol.php
diff --git a/lib/php/lib/Thrift/Protocol/TBinaryProtocolAccelerated.php b/lib/php/lib/Protocol/TBinaryProtocolAccelerated.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TBinaryProtocolAccelerated.php
rename to lib/php/lib/Protocol/TBinaryProtocolAccelerated.php
diff --git a/lib/php/lib/Thrift/Protocol/TCompactProtocol.php b/lib/php/lib/Protocol/TCompactProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TCompactProtocol.php
rename to lib/php/lib/Protocol/TCompactProtocol.php
diff --git a/lib/php/lib/Thrift/Protocol/TJSONProtocol.php b/lib/php/lib/Protocol/TJSONProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TJSONProtocol.php
rename to lib/php/lib/Protocol/TJSONProtocol.php
diff --git a/lib/php/lib/Thrift/Protocol/TMultiplexedProtocol.php b/lib/php/lib/Protocol/TMultiplexedProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TMultiplexedProtocol.php
rename to lib/php/lib/Protocol/TMultiplexedProtocol.php
diff --git a/lib/php/lib/Thrift/Protocol/TProtocol.php b/lib/php/lib/Protocol/TProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TProtocol.php
rename to lib/php/lib/Protocol/TProtocol.php
diff --git a/lib/php/lib/Thrift/Protocol/TProtocolDecorator.php b/lib/php/lib/Protocol/TProtocolDecorator.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TProtocolDecorator.php
rename to lib/php/lib/Protocol/TProtocolDecorator.php
diff --git a/lib/php/lib/Thrift/Protocol/TSimpleJSONProtocol.php b/lib/php/lib/Protocol/TSimpleJSONProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/Protocol/TSimpleJSONProtocol.php
rename to lib/php/lib/Protocol/TSimpleJSONProtocol.php
diff --git a/lib/php/lib/Thrift/Serializer/TBinarySerializer.php b/lib/php/lib/Serializer/TBinarySerializer.php
similarity index 100%
rename from lib/php/lib/Thrift/Serializer/TBinarySerializer.php
rename to lib/php/lib/Serializer/TBinarySerializer.php
diff --git a/lib/php/lib/Thrift/Server/TForkingServer.php b/lib/php/lib/Server/TForkingServer.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TForkingServer.php
rename to lib/php/lib/Server/TForkingServer.php
diff --git a/lib/php/lib/Thrift/Server/TSSLServerSocket.php b/lib/php/lib/Server/TSSLServerSocket.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TSSLServerSocket.php
rename to lib/php/lib/Server/TSSLServerSocket.php
diff --git a/lib/php/lib/Thrift/Server/TServer.php b/lib/php/lib/Server/TServer.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TServer.php
rename to lib/php/lib/Server/TServer.php
diff --git a/lib/php/lib/Thrift/Server/TServerSocket.php b/lib/php/lib/Server/TServerSocket.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TServerSocket.php
rename to lib/php/lib/Server/TServerSocket.php
diff --git a/lib/php/lib/Thrift/Server/TServerTransport.php b/lib/php/lib/Server/TServerTransport.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TServerTransport.php
rename to lib/php/lib/Server/TServerTransport.php
diff --git a/lib/php/lib/Thrift/Server/TSimpleServer.php b/lib/php/lib/Server/TSimpleServer.php
similarity index 100%
rename from lib/php/lib/Thrift/Server/TSimpleServer.php
rename to lib/php/lib/Server/TSimpleServer.php
diff --git a/lib/php/lib/Thrift/StoredMessageProtocol.php b/lib/php/lib/StoredMessageProtocol.php
similarity index 100%
rename from lib/php/lib/Thrift/StoredMessageProtocol.php
rename to lib/php/lib/StoredMessageProtocol.php
diff --git a/lib/php/lib/Thrift/StringFunc/Core.php b/lib/php/lib/StringFunc/Core.php
similarity index 100%
rename from lib/php/lib/Thrift/StringFunc/Core.php
rename to lib/php/lib/StringFunc/Core.php
diff --git a/lib/php/lib/Thrift/StringFunc/Mbstring.php b/lib/php/lib/StringFunc/Mbstring.php
similarity index 100%
rename from lib/php/lib/Thrift/StringFunc/Mbstring.php
rename to lib/php/lib/StringFunc/Mbstring.php
diff --git a/lib/php/lib/Thrift/StringFunc/TStringFunc.php b/lib/php/lib/StringFunc/TStringFunc.php
similarity index 100%
rename from lib/php/lib/Thrift/StringFunc/TStringFunc.php
rename to lib/php/lib/StringFunc/TStringFunc.php
diff --git a/lib/php/lib/Thrift/TMultiplexedProcessor.php b/lib/php/lib/TMultiplexedProcessor.php
similarity index 100%
rename from lib/php/lib/Thrift/TMultiplexedProcessor.php
rename to lib/php/lib/TMultiplexedProcessor.php
diff --git a/lib/php/lib/Thrift/Transport/TBufferedTransport.php b/lib/php/lib/Transport/TBufferedTransport.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TBufferedTransport.php
rename to lib/php/lib/Transport/TBufferedTransport.php
diff --git a/lib/php/lib/Thrift/Transport/TCurlClient.php b/lib/php/lib/Transport/TCurlClient.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TCurlClient.php
rename to lib/php/lib/Transport/TCurlClient.php
diff --git a/lib/php/lib/Thrift/Transport/TFramedTransport.php b/lib/php/lib/Transport/TFramedTransport.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TFramedTransport.php
rename to lib/php/lib/Transport/TFramedTransport.php
diff --git a/lib/php/lib/Thrift/Transport/THttpClient.php b/lib/php/lib/Transport/THttpClient.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/THttpClient.php
rename to lib/php/lib/Transport/THttpClient.php
diff --git a/lib/php/lib/Thrift/Transport/TMemoryBuffer.php b/lib/php/lib/Transport/TMemoryBuffer.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TMemoryBuffer.php
rename to lib/php/lib/Transport/TMemoryBuffer.php
diff --git a/lib/php/lib/Thrift/Transport/TNullTransport.php b/lib/php/lib/Transport/TNullTransport.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TNullTransport.php
rename to lib/php/lib/Transport/TNullTransport.php
diff --git a/lib/php/lib/Thrift/Transport/TPhpStream.php b/lib/php/lib/Transport/TPhpStream.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TPhpStream.php
rename to lib/php/lib/Transport/TPhpStream.php
diff --git a/lib/php/lib/Thrift/Transport/TSSLSocket.php b/lib/php/lib/Transport/TSSLSocket.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TSSLSocket.php
rename to lib/php/lib/Transport/TSSLSocket.php
diff --git a/lib/php/lib/Thrift/Transport/TSocket.php b/lib/php/lib/Transport/TSocket.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TSocket.php
rename to lib/php/lib/Transport/TSocket.php
diff --git a/lib/php/lib/Thrift/Transport/TSocketPool.php b/lib/php/lib/Transport/TSocketPool.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TSocketPool.php
rename to lib/php/lib/Transport/TSocketPool.php
diff --git a/lib/php/lib/Thrift/Transport/TTransport.php b/lib/php/lib/Transport/TTransport.php
similarity index 100%
rename from lib/php/lib/Thrift/Transport/TTransport.php
rename to lib/php/lib/Transport/TTransport.php
diff --git a/lib/php/lib/Thrift/Type/TConstant.php b/lib/php/lib/Type/TConstant.php
similarity index 100%
rename from lib/php/lib/Thrift/Type/TConstant.php
rename to lib/php/lib/Type/TConstant.php
diff --git a/lib/php/lib/Thrift/Type/TMessageType.php b/lib/php/lib/Type/TMessageType.php
similarity index 100%
rename from lib/php/lib/Thrift/Type/TMessageType.php
rename to lib/php/lib/Type/TMessageType.php
diff --git a/lib/php/lib/Thrift/Type/TType.php b/lib/php/lib/Type/TType.php
similarity index 100%
rename from lib/php/lib/Thrift/Type/TType.php
rename to lib/php/lib/Type/TType.php
diff --git a/lib/php/test/Test/Thrift/Fixtures.php b/lib/php/test/Fixtures.php
similarity index 100%
rename from lib/php/test/Test/Thrift/Fixtures.php
rename to lib/php/test/Fixtures.php
diff --git a/lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php b/lib/php/test/JsonSerialize/JsonSerializeTest.php
similarity index 96%
rename from lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php
rename to lib/php/test/JsonSerialize/JsonSerializeTest.php
index a6b0e7b..dfb34c3 100644
--- a/lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php
+++ b/lib/php/test/JsonSerialize/JsonSerializeTest.php
@@ -23,10 +23,10 @@
 use stdClass;
 use Thrift\ClassLoader\ThriftClassLoader;
 
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
 
 $loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages/phpjs');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages/phpjs');
 $loader->register();
 
 class JsonSerializeTest extends \PHPUnit_Framework_TestCase
diff --git a/lib/php/test/Makefile.am b/lib/php/test/Makefile.am
index c4dcde3..5658afa 100755
--- a/lib/php/test/Makefile.am
+++ b/lib/php/test/Makefile.am
@@ -35,16 +35,16 @@
 all-local: deps
 
 check-json-serializer: deps stubs
-	$(PHPUNIT) --log-junit=TEST-json-serializer.xml Test/Thrift/JsonSerialize/
+	$(PHPUNIT) --log-junit=TEST-json-serializer.xml JsonSerialize/
 
 check-validator: deps stubs
-	php Test/Thrift/TestValidators.php
-	php Test/Thrift/TestValidators.php -oop
+	php TestValidators.php
+	php TestValidators.php -oop
 
 check-protocol:	deps stubs
-	$(PHPUNIT) --log-junit=TEST-log-json-protocol.xml Test/Thrift/Protocol/TestTJSONProtocol.php
-	$(PHPUNIT) --log-junit=TEST-binary-serializer.xml Test/Thrift/Protocol/TestBinarySerializer.php
-	$(PHPUNIT) --log-junit=TEST-log-simple-json-protocol.xml Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
+	$(PHPUNIT) --log-junit=TEST-log-json-protocol.xml Protocol/TestTJSONProtocol.php
+	$(PHPUNIT) --log-junit=TEST-binary-serializer.xml Protocol/TestBinarySerializer.php
+	$(PHPUNIT) --log-junit=TEST-log-simple-json-protocol.xml Protocol/TestTSimpleJSONProtocol.php
 
 check: deps stubs \
   check-protocol \
@@ -54,7 +54,3 @@
 clean-local:
 	$(RM) -r ./packages
 	$(RM) TEST-*.xml
-
-EXTRA_DIST = \
-	Test \
-	TestValidators.thrift
diff --git a/lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php b/lib/php/test/Protocol/TestBinarySerializer.php
similarity index 92%
rename from lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php
rename to lib/php/test/Protocol/TestBinarySerializer.php
index b30cf3d..e08057b 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php
+++ b/lib/php/test/Protocol/TestBinarySerializer.php
@@ -26,10 +26,10 @@
 use Thrift\ClassLoader\ThriftClassLoader;
 use Thrift\Serializer\TBinarySerializer;
 
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
 
 $loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
 $loader->register();
 
 /***
diff --git a/lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php b/lib/php/test/Protocol/TestTJSONProtocol.php
similarity index 99%
rename from lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php
rename to lib/php/test/Protocol/TestTJSONProtocol.php
index a41b081..1c34efb 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php
+++ b/lib/php/test/Protocol/TestTJSONProtocol.php
@@ -30,10 +30,10 @@
 
 define( 'BUFSIZ', 8192 ); //big enough to read biggest serialized Fixture arg.
 
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
 
 $loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
 $loader->register();
 
 /***
diff --git a/lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php b/lib/php/test/Protocol/TestTSimpleJSONProtocol.php
similarity index 98%
rename from lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
rename to lib/php/test/Protocol/TestTSimpleJSONProtocol.php
index 5a8e9e6..1f696a5 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
+++ b/lib/php/test/Protocol/TestTSimpleJSONProtocol.php
@@ -30,10 +30,10 @@
 
 define( 'BUFSIZ', 8192 ); //big enough to read biggest serialized Fixture arg.
 
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
 
 $loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
 $loader->register();
 
 /***
diff --git a/lib/php/test/Test/Thrift/TestValidators.php b/lib/php/test/TestValidators.php
similarity index 94%
rename from lib/php/test/Test/Thrift/TestValidators.php
rename to lib/php/test/TestValidators.php
index a6c13c5..84c01f8 100644
--- a/lib/php/test/Test/Thrift/TestValidators.php
+++ b/lib/php/test/TestValidators.php
@@ -18,9 +18,9 @@
  * under the License.
  */
 
-namespace Test\Thrift;
+namespace test\Thrift;
 
-require_once __DIR__.'/../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../vendor/autoload.php';
 
 use Thrift\ClassLoader\ThriftClassLoader;
 use Thrift\Exception\TProtocolException;
@@ -31,8 +31,8 @@
 $GEN_DIR = $oop_mode ? 'phpvo' : 'phpv';
 
 $loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../packages/' . $GEN_DIR);
-$loader->registerDefinition('TestValidators', __DIR__ . '/../../packages/' . $GEN_DIR);
+$loader->registerDefinition('ThriftTest', __DIR__ . '/packages/' . $GEN_DIR);
+$loader->registerDefinition('TestValidators', __DIR__ . '/packages/' . $GEN_DIR);
 $loader->register();
 
 // Would be nice to have PHPUnit here, but for now just hack it.
diff --git a/tutorial/php/PhpClient.php b/tutorial/php/PhpClient.php
index d262b8f..92dc3cb 100755
--- a/tutorial/php/PhpClient.php
+++ b/tutorial/php/PhpClient.php
@@ -5,7 +5,7 @@
 
 error_reporting(E_ALL);
 
-require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
+require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
 
 use Thrift\ClassLoader\ThriftClassLoader;
 
diff --git a/tutorial/php/PhpServer.php b/tutorial/php/PhpServer.php
index 22ae43e..5a9b49b 100755
--- a/tutorial/php/PhpServer.php
+++ b/tutorial/php/PhpServer.php
@@ -5,7 +5,7 @@
 
 error_reporting(E_ALL);
 
-require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
+require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
 
 use Thrift\ClassLoader\ThriftClassLoader;