You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dc...@apache.org on 2019/10/18 13:09:13 UTC

[thrift] branch master updated: THRIFT-4975: Add Makefile.am to the PHP tutorial

This is an automated email from the ASF dual-hosted git repository.

dcelasun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 538e36c  THRIFT-4975: Add Makefile.am to the PHP tutorial
538e36c is described below

commit 538e36c645d6e56748c6af3ef80ef21b26646ed2
Author: Kengo Seki <se...@apache.org>
AuthorDate: Fri Oct 18 22:09:01 2019 +0900

    THRIFT-4975: Add Makefile.am to the PHP tutorial
    
    Client: php
    
    This closes #1900.
---
 configure.ac               |  1 +
 tutorial/Makefile.am       |  5 ++++-
 tutorial/php/Makefile.am   | 36 ++++++++++++++++++++++++++++++++++++
 tutorial/php/PhpClient.php |  2 +-
 tutorial/php/PhpServer.php |  2 +-
 5 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index adebe9e..4892362 100755
--- a/configure.ac
+++ b/configure.ac
@@ -872,6 +872,7 @@ AC_CONFIG_FILES([
   tutorial/nodejs/Makefile
   tutorial/dart/Makefile
   tutorial/perl/Makefile
+  tutorial/php/Makefile
   tutorial/py/Makefile
   tutorial/py.twisted/Makefile
   tutorial/py.tornado/Makefile
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 @@ if WITH_PERL
 SUBDIRS += perl
 endif
 
+if WITH_PHP
+SUBDIRS += php
+endif
+
 #
 # generate html for ThriftTest.thrift
 #
@@ -108,7 +112,6 @@ EXTRA_DIST = \
 	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 @@ require_once __DIR__.'/../../vendor/autoload.php';
 
 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 @@ require_once __DIR__.'/../../vendor/autoload.php';
 
 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');