THRIFT-4975: Add Makefile.am to the PHP tutorial
Client: php
This closes #1900.
diff --git a/tutorial/Makefile.am b/tutorial/Makefile.am
index 9160ad0..49d18fb 100755
--- a/tutorial/Makefile.am
+++ b/tutorial/Makefile.am
@@ -87,6 +87,10 @@
SUBDIRS += perl
endif
+if WITH_PHP
+SUBDIRS += php
+endif
+
#
# generate html for ThriftTest.thrift
#
@@ -108,7 +112,6 @@
erl \
hs \
ocaml \
- php \
shared.thrift \
tutorial.thrift \
README.md
diff --git a/tutorial/php/Makefile.am b/tutorial/php/Makefile.am
new file mode 100755
index 0000000..65f4879
--- /dev/null
+++ b/tutorial/php/Makefile.am
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+gen-php/tutorial/Calculator.php gen-php/shared/SharedService.php: $(top_srcdir)/tutorial/tutorial.thrift
+ $(THRIFT) --gen php:server -r $<
+
+all-local: gen-php/tutorial/Calculator.php
+
+tutorialserver: all
+ ${PYTHON} runserver.py
+
+tutorialclient: all
+ ${PHP} PhpClient.php --http
+
+clean-local:
+ $(RM) -r gen-*
+
+EXTRA_DIST = \
+ PhpServer.php \
+ PhpClient.php
diff --git a/tutorial/php/PhpClient.php b/tutorial/php/PhpClient.php
index eb2c2e5..5ac1547 100755
--- a/tutorial/php/PhpClient.php
+++ b/tutorial/php/PhpClient.php
@@ -9,7 +9,7 @@
use Thrift\ClassLoader\ThriftClassLoader;
-$GEN_DIR = realpath(dirname(__FILE__).'/..').'/gen-php';
+$GEN_DIR = realpath(dirname(__FILE__)).'/gen-php';
$loader = new ThriftClassLoader();
$loader->registerNamespace('Thrift', __DIR__ . '/../../lib/php/lib');
diff --git a/tutorial/php/PhpServer.php b/tutorial/php/PhpServer.php
index 749da3a..f4b3b31 100755
--- a/tutorial/php/PhpServer.php
+++ b/tutorial/php/PhpServer.php
@@ -9,7 +9,7 @@
use Thrift\ClassLoader\ThriftClassLoader;
-$GEN_DIR = realpath(dirname(__FILE__).'/..').'/gen-php';
+$GEN_DIR = realpath(dirname(__FILE__)).'/gen-php';
$loader = new ThriftClassLoader();
$loader->registerNamespace('Thrift', __DIR__ . '/../../lib/php/lib');