Help us understand the problem. What is going on with this article?

zend-expressive-skeletonをGoogleAppEngine/PHP向けにカスタマイズ

More than 3 years have passed since last update.

Zend公式のPSR-7対応マイクロフレームワーク「zend-expressive」

簡単にインストールできるスケルトンプロジェクトが用意されていますが、
前回の「zend-expressive-skeletonをGoogleAppEngine/PHPにインストール」で試した通り、
そのままではAppEngineで利用できないため、カスタマイズしてみました。

https://github.com/curious-eyes/zend-expressive-skeleton/tree/for-google-app-engine

composerコマンドを使ってインストールできるように、packages.json も準備しています。

https://gist.github.com/curious-eyes/5d2b9188f641682720c03fbc7e4fce8b

以下のように packeges.json を指定して、実行してください。
<project dir> 部分はインストール先ディレクトリです。

$ composer create-project --repository-url=https://gist.githubusercontent.com/curious-eyes/5d2b9188f641682720c03fbc7e4fce8b/raw/0c2f913398660395dc81f0f9414579c441c22783/packages.json --stability=dev zendframework/zend-expressive-skeleton <project dir>

skeleton をインストール

前述のcomposerコマンドを実行すると、インストーラーが開始します。
以下の例では、テンプレートエンジンを「Plates」にした以外は、デフォルトのままです。

Minimal skeleton? (no default middleware, templates, or assets; configuration only)
  [y] Yes (minimal)
  [n] No (full; recommended)
  Make your selection (No):

Which router do you want to use?
  [1] Aura.Router
  [2] FastRoute
  [3] Zend Router
  Make your selection or type a composer package name and version (FastRoute):

Which container do you want to use for dependency injection?
  [1] Aura.Di
  [2] Pimple
  [3] Zend ServiceManager
  Make your selection or type a composer package name and version (Zend ServiceManager):

Which template engine do you want to use?
  [1] Plates
  [2] Twig
  [3] Zend View installs Zend ServiceManager
  [n] None of the above
  Make your selection or type a composer package name and version (n): 1

Which error handler do you want to use during development?
  [1] Whoops
  [n] None of the above
  Make your selection or type a composer package name and version (Whoops):

ローカル環境で動作確認

参考: https://cloud.google.com/appengine/docs/php/quickstart#test_the_application

完了すると、<project dir>配下に app.yaml が生成されているはずですので、
そのままSDKで動作確認できます。

$ dev_appserver.py <project dir>

ブラウザで、localhost:8080 にアクセスして、以下の画面になれば成功です。

Zend Expressive

デプロイ

参考: https://cloud.google.com/appengine/docs/php/quickstart#deploy_your_app

https://console.developers.google.com/
で、プロジェクトを作成して、該当のプロジェクトIDに向けてデプロイしましょう。

$ appcfg.py -A YOUR_PROJECT_ID update app.yaml

ブラウザで、以下のURLにアクセスして確認できます。
http://(YOUR_PROJECT_ID).appspot.com/

引き続き、アプリケーションの開発を進めていきます。
参考: Introduction to Zend Expressive — Master Zend Framework

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away