際際滷

際際滷Share a Scribd company logo
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://
鍖les.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

More Related Content

Google App Engine: For PHP Developers

  • 1. Abu Ashraf Masnun @masnun GOOGLE APP ENGINE: FOR PHP DEVELOPERS
  • 3. What do we need? ≒Vagrant (http://vagrantup.com) ≒VirtualBox ≒SSH Client ≒Quick Q&A ≒What is Vagrant? ≒What is VirtualBox? ≒SSH Client
  • 4. Setting Up ≒ vagrant init ≒ vagrant box add precise64 http:// 鍖les.vagrantup.com/precise64.box ≒ vagrant up ≒ vagrant ssh
  • 5. 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
  • 6. Running The Server google_appengine/dev_appserver.py -足-足host=0.0.0.0 -足-足php_executable_path=`which php-足cgi` /vagrant/<app>/
  • 11. 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()
  • 12. Memcached Stubbed functions in the Memcached API ≒ addServer() ≒ addServers() ≒ getAllKeys() ≒ getServerByKey() ≒ getServerList() ≒ getStats() ≒ getVersion() ≒ isPersistent() ≒ isPristine() ≒ quit() ≒ resetServerList() ≒ setSaslAuthData()
  • 13. Task Queues ≒10 minutes execution time (normal req < 60sec) ≒Must return HTTP Response 200-足299
  • 16. Publishing The App appcfg.py update <app name>
  • 17. Q&A