GAE for PHP - 10 Min to Learn

18
10 Min to Learn GAE for PHP http://goo.gl/rDRSH6

description

Create a project using php to learn that how to use the basic settings in GAE.

Transcript of GAE for PHP - 10 Min to Learn

Page 1: GAE for PHP - 10 Min to Learn

10 Min to Learn GAE for PHPhttp://goo.gl/rDRSH6

Page 2: GAE for PHP - 10 Min to Learn

WHO AM I

Ethan - 陳禕寰

Front-End Engineer

Page 3: GAE for PHP - 10 Min to Learn

Introduction

● Installing the SDK● Build an App Engine application using PHP

○ Hello GAE Example○ Handling Forms○ Using Static File ( CSS and Images )

● Uploading your application○ Regist、Create、Upload

Page 5: GAE for PHP - 10 Min to Learn

Installing the SDK - Windows

1. Python 2.72. PHP SDK for App Engine3. MySQL(Community Server for Local Development)

Page 6: GAE for PHP - 10 Min to Learn

Installing the SDK - Mac OS X

1. Check python version : needs 2.7 /usr/bin/env python -v if not 2.7 > https://www.python.org/downloads/ 2. Installing MySQL

Page 7: GAE for PHP - 10 Min to Learn

Introduction

● Installing the SDK● Build an App Engine application using PHP

○ Hello GAE Example○ Handling Forms○ Using Static File ( CSS and Images )

● Uploading your application○ Regist、Create、Upload

Page 8: GAE for PHP - 10 Min to Learn

Hello GAE!

1. Creating a simple script● hello.php

2. Creating the configuration file● app.yaml

3. Test the application!● Do it!

Page 9: GAE for PHP - 10 Min to Learn

Hello GAE Example!

Page 10: GAE for PHP - 10 Min to Learn

Introduction

● Installing the SDK● Build an App Engine application using PHP

○ Hello GAE Example○ Handling Forms○ Using Static File ( CSS and Images )

● Uploading your application○ Regist、Create、Upload

Page 11: GAE for PHP - 10 Min to Learn

Handling FormsEdit hello.php and try submitting messages

Page 12: GAE for PHP - 10 Min to Learn

Introduction

● Installing the SDK● Build an App Engine application using PHP

○ Hello GAE Example○ Handling Forms○ Using Static File ( CSS and Images )

● Uploading your application○ Regist、Create、Upload

Page 13: GAE for PHP - 10 Min to Learn

Using Static Files - CSS or Images

1. Edit app.yaml and replace its contents.2. Create the directory stylesheets, and create

a new file named main.css.

Page 14: GAE for PHP - 10 Min to Learn

Introduction

● Installing the SDK● Build an App Engine application using PHP

○ Hello GAE Example○ Handling Forms○ Using Static File ( CSS and Images )

● Uploading your application○ Regist、Create、Upload

Page 15: GAE for PHP - 10 Min to Learn

Registering an app on GAE

Go to https://appengine.google.com/ or thisand log in with your Google account,then create application.

Page 16: GAE for PHP - 10 Min to Learn

Create Project

Page 17: GAE for PHP - 10 Min to Learn

Uploading the Application

1. Uploading via command line○ appcfg.py update helloworld/

2. Use the App Engine Launcher

3. Using Git

http://your_app_id.appspot.com

Page 18: GAE for PHP - 10 Min to Learn

Demo code

http://goo.gl/ETs6c9