google app engine: for php developers
Post on 07-Jul-2015
593 Views
Preview:
DESCRIPTION
TRANSCRIPT
Abu Ashraf Masnun @masnun
GOOGLE APP ENGINE: FOR PHP DEVELOPERS
WHY PHP?
What do we need? • Vagrant (http://vagrantup.com) • VirtualBox • SSH Client
• Quick Q&A • What is Vagrant? • What is VirtualBox? • SSH Client
Setting Up • vagrant init • vagrant box add precise64 http://
files.vagrantup.com/precise64.box
• vagrant up • vagrant ssh
Get PHP & App Engine • sudo apt-‐get install lamp-‐server^ • sudo apt-‐get install php5-‐cgi • wget https://commondatastorage.googleapis.com/appengine-‐sdks/featured/google_appengine_1.9.2.zip • unzip google_appengine_1.9.2.zip
Running The Server
google_appengine/dev_appserver.py -‐-‐host=0.0.0.0 -‐-‐php_executable_path=`which php-‐cgi` /vagrant/<app>/
app.yaml
index.php
User Service
Sending Email
Memcache Stubbed functions in the Memcache API • memcache_add_server() • memcache_close() • memcache_connect() • memcache_pconnect() • memcache_set_compress_threshold() • addServer() • close() • connect() • pconnect() • setCompressThreshold()
Memcached Stubbed functions in the Memcached API • addServer() • addServers() • getAllKeys() • getServerByKey() • getServerList() • getStats() • getVersion() • isPersistent() • isPristine() • quit() • resetServerList() • setSaslAuthData()
Task Queues • 10 minutes execution time (normal req < 60sec) • Must return HTTP Response 200-‐299
PushQueue – Multiple Tasks
Cron Jobs
Publishing The App
appcfg.py update <app name>
Q&A
top related