google app engine: for php developers

17
Abu Ashraf Masnun @masnun GOOGLE APP ENGINE: FOR PHP DEVELOPERS

Upload: abu-ashraf-masnun

Post on 07-Jul-2015

593 views

Category:

Technology


5 download

DESCRIPTION

Google App Engine for PHP Developers - my session in G-Days Bangladesh organized by local Google Developers Groups and Google Business Groups

TRANSCRIPT

Page 1: Google App Engine: For PHP Developers

Abu  Ashraf  Masnun    @masnun  

GOOGLE  APP  ENGINE:  FOR  PHP  DEVELOPERS  

Page 2: Google App Engine: For PHP Developers

WHY  PHP?  

Page 3: Google App Engine: For PHP Developers

What  do  we  need?  • Vagrant  (http://vagrantup.com)  • VirtualBox  • SSH  Client  

• Quick  Q&A  • What  is  Vagrant?  • What  is  VirtualBox?  • SSH  Client  

Page 4: Google App Engine: For PHP Developers

Setting  Up  •  vagrant  init  •  vagrant  box  add  precise64  http://

files.vagrantup.com/precise64.box            

•  vagrant  up  •  vagrant  ssh  

Page 5: Google App Engine: For PHP Developers

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    

Page 6: Google App Engine: For PHP Developers

Running  The  Server  

google_appengine/dev_appserver.py      -­‐-­‐host=0.0.0.0      -­‐-­‐php_executable_path=`which  php-­‐cgi`        /vagrant/<app>/  

Page 7: Google App Engine: For PHP Developers

app.yaml  

Page 8: Google App Engine: For PHP Developers

index.php  

Page 9: Google App Engine: For PHP Developers

User  Service  

Page 10: Google App Engine: For PHP Developers

Sending  Email  

Page 11: Google App Engine: For PHP Developers

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()  

Page 12: Google App Engine: For PHP Developers

Memcached  Stubbed  functions  in  the  Memcached  API    •  addServer()  •  addServers()  •  getAllKeys()  •  getServerByKey()  •  getServerList()  •  getStats()  •  getVersion()  •  isPersistent()  •  isPristine()  •  quit()  •  resetServerList()  •  setSaslAuthData()  

Page 13: Google App Engine: For PHP Developers

Task  Queues    • 10  minutes  execution  time  (normal  req  <  60sec)  • Must  return  HTTP  Response  200-­‐299  

Page 14: Google App Engine: For PHP Developers

PushQueue  –  Multiple  Tasks  

Page 15: Google App Engine: For PHP Developers

Cron  Jobs  

Page 16: Google App Engine: For PHP Developers

Publishing  The  App  

appcfg.py  update  <app  name>  

Page 17: Google App Engine: For PHP Developers

Q&A