GithubHelp home page GithubHelp logo

oitmain-public / yii2-app-gae-flex Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 97 KB

Yii2 App boilerplate for Google App Engine Flex Environment

License: Other

PHP 89.01% Batchfile 1.92% Shell 5.64% CSS 3.43%
yii gae-flex flex-environment gae yii2

yii2-app-gae-flex's Introduction

yii2-app-gae-flex

Create Yii2 basic application for deploy on Google App Engine (Flex Environment)

Flex Environment allows read and write on the directory sys_get_temp_dir(), which allows Yii2 to use the runtime folder

However, static assets are uploaded into Google Storage for public access

(Advance branch adds local environment support and pretty url)

Instruction for advance branch : https://github.com/oitmain-public/yii2-app-gae-flex/blob/advanced/README.md

Prerequisites

  • Create a Google Storage bucket with permission Storage Object Viewer to allUsers
  • Create a json key file for user @appspot.gserviceaccount.com
  • Enable "Google App Engine Admin API"
  • Enable "Google App Engine Flexible Environment"
  • Enable "Cloud SQL API" on app engine project
  • Enable "Google Service Management API"
  • Enable cors on new storage bucket
$ echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json \
&& gsutil cors set cors-config.json gs://<your-bucket-name>

Installalion

Clone project and install composer requirements

$ git clone https://github.com/oitmain-public/yii2-app-gae-flex
$ # For Advanced app, clone following branch instead
$ # git clone -b advanced https://github.com/oitmain-public/yii2-app-gae-flex
$ cd yii2-app-gae-flex
$ composer install

Copy and update configuration files

$ cp app.yaml.dist app.yaml

Update config/web.php

  • assetsManager and cookieValidationKey

Local Deployment

$ php -S localhost:8080 -t web/

Deploy to Google App Engine

See https://cloud.google.com/appengine/docs/flexible/php/testing-and-deploying-your-app

$ gcloud app deploy —version [YOUR_VERSION_ID] —no-promote —project [YOUR_PROJECT_ID] 

Google Cloud SQL

Troubleshooting

  • A circular dependency is detected for bundle
    • This error occurs when asset bundle is called twice. Once for front view, and once for error view.   * Use app\models\PhpErrorHandler to see the actual error without calling the error view

yii2-app-gae-flex's People

Contributors

patrick-yi-82 avatar

Stargazers

Jimy Navarro Cordova avatar Luis Gonzalez avatar Mads Nedergaard avatar Cyrille (Asim) B. Delavenne avatar Salem Ouerdani avatar

Watchers

James Cloos avatar  avatar Jason avatar  avatar Cyrille (Asim) B. Delavenne avatar

Forkers

dbd5 metd

yii2-app-gae-flex's Issues

Questions: Setting Google configuration, credentials and Cloud SQL

Hello!

First of all, thanks for making this boilerplate of Yii 2 for GAE Flex. It's been super useful already!
With that said, I had some questions regarding additional configuration settings.

  1. For Yii 2 to connect correctly to CloudSQL correctly, where would you set the cloudsql connection name (i.e. your_project_name:your_region:your_instance)?
  2. Where would the Google Project ID be set?
  3. Do you know if Google OAuth would work with Yii 2 (providing we give it a generated Client ID and Secret)?

Most of my questions stem from following along the Google Cloud PHP Bookshelf App tutorial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.