SlideShare a Scribd company logo
1 of 17
Download to read offline
GOOGLE APPENGINE AVEC PHP
SUMBANG CHRISTIAN BAUREL
SKYPE : TEMZY1988
TECHNICAL MANAGER GDG DOUALA
FACEBOOK : SUMBANG CHRISTIAN BAUREL
GOOGLE+ : SUMBANG CHRISTIAN BAUREL
TWITTER : @CHRISTIANBAUREL
LE DÉBUT DE L’AVENTURE : MAI 2013
• AU LANCEMENT DE LA PLATEFORME APPENGINE PHP N’ÉTAIT PAS PARMI LES LANGAGES
SUPPORTÉS, JAVA D’AILLEURS N’ÉTAIT PAS PRISE EN CHARGE; SEUL PYTHON ÉTAIT SUPPORTÉS
• QUELQUES ANNÉES PLU TARD JAVA A ÉTÉ PRISE EN CHARGE SUITE A LA FORTE DEMANDE DE LA
COMMUNAUTÉ JAVA, PLUS TARD GO LE LANGAGE PROPRIÉTAIRE DE GOOGLE A LUI AUSSI ÉTÉ
PRIS EN CHARGE PAR LA PLATEFORME
• LA PRISE EN CHARGE DE PHP EST SURVENUE EN MAI DERNIER LORS DU GOOGLE IO, CERTES
CETTE PRISE EN CHARGE EST ENCORE LIMITE PAR RAPPORT AU AUTRES LANGAGES TEL JAVA ET
PYTHON
APPENGINE ET PHP : L’UNION PARFAITE
• POURQUOI UNION PARFAITE ? PHP EST LE LANGAGE WEB LE PLUS POPULAIRE ET LE PLUS
UTILISÉ AU MONDE, APPENGINE EST UNE PLATEFORME D’HÉBERGEMENT CLOUD, NE PAS
PROPOSER PHP COMME LANGAGE SUPPORTÉ PAR APPENGINE ÉTAIT INCOMPRÉHENSIBLE DE
MON POINT DE VUE

• AVEC LE SUPPORT DE PHP, APPENGINE S’OUVRE A UNE ÉNORME COMMUNAUTÉ DE
DÉVELOPPEURS ET A DES MILLIONS D’APPLICATIONS POTENTIELS QUI Y SERONT HÉBERGÉES
• LA PRISE EN CHARGE DE PHP EST ENCORE A SES DÉBUTS, MAIS TOUT ME LAISSE PENSER QUE
D’ICI QUELQUES ANNÉES, ELLE SERA COMPLÈTE ET PARFAITEMENT UTILISABLE
APPENGINE ET PHP : LES LIMITES ET RESTRICTIONS
• COMME DIT, LA PRISE EN CHARGE DE PHP EST ENCORE AU STADE EMBRYONNAIRE, CERTAINES
EXTENSIONS NE SONT PAS PRISE EN CHARGE, MAIS LE NÉCESSAIRE POUR LE DÉVELOPPEMENT
EST ACTIF
• PARMI LES EXTENSIONS PHP ACTIVES, ON RETROUVERA DES EXTENSIONS TEL : APC, BCMATCH,
CORE, CALENDAR, CTYPE, DATE, DOM, EREG, FILTER, GD, HASH, ICONV, JSON, LIBXML,
MBSTRING, MSCRIPT, MEMCACHE, MEMCACHED, MYSQL, MYSQLI, MSQLND, OAUTH, OPENSSL,
PCRE, PDO, PDO_MYSQL, REFLECTION, SESSION, SHMOP, SIMPLEXML, SOAP, SPL, STANDARD,
TOKENIZER, XML, XMLREADER, XMLREADER, ZLIB
APPENGINE ET PHP : LIMITE ET RESTRICTIONS
• CERTAINES FONCTIONNALITÉS DE PHP ONT ÉTÉ DÉSACTIVÉES POUR DES RAISONS DE SÉCURITÉ,
CERTAINES PEUVENT ÊTRE ACTIVES AU BESOIN DANS LE FICHIER PHP.INI, ENTRE AUTRES ON A :
DISK_FREE_SPACE(), DISK_TOTAL_SPACE(), DISKFREESPACE(), ESCAPESHELLARG() AND
ESCAPESHELLCMD(), EXEC(), FSOCKOPEN(), GETHOSTNAME(), HIGHLIGHT_FILE(), LINK(),
PASSTHRU(), POPEN(), PROC_CLOSE(), PROG_GET_STATUS(), PROC_NICE(), PROC_OPEN()
AND PROC_TERMINATE(), SET_TIME_LIMIT(), SHELL_EXEC(), SHOW_SOURCE(), SYMLINK(),
SYSTEM(), TMPFILE(), TEMPNAM()
APPENGINE ET PHP : LIMITES ET RESTRICTIONS
• IL EST POSSIBLE D’UTILISER DU CODE PHP DANS SES APP APPENGINE, MAIS CELA DOIT ÊTRE
UNE SYNTAXE PUR PHP
• DE MÊME IL EST POSSIBLE D’INTÉGRER HTML, JAVASCRIPT ET CSS DANS NOS APPLICATIONS
APPENGINE, CONCERNANT JAVASCRIPT ET CSS NOUS DEVONS SIGNALER LEUR UTILISATION
DANS LE FICHIER DE CONFIGURATION DE NOTRE APPLICATION (APP.YAML), NOUS
REVIENDRONS SUR CE FICHIER PLUS TARD
• LA VERSION DE PHP SUPPORTÉS POUR L’INSTANT EST LA 5.4, VOTRE APPLICATION DOIT DONC
ÊTRE FAITE AU MINIMUM AVEC LA VERSION 5.4 DE PHP
APPENGINE ET PHP : QUOTAS ET SANDBOX
• LE SANDBOX SIGNIFIE BAC A SABLE EN FRANÇAIS, C’EST LE LIEU OU EST EXÉCUTÉ VOTRE
APPLICATION APPENGINE, C’EST UN ESPACE DÉDIÉE À L’EXÉCUTION DE VOTRE APPLICATION SANS
AUCUNE INCIDENCE SUR LES AUTRES APPLICATIONS HÉBERGÉES PAR APPENGINE OU SUR LA
PLATEFORME APPENGINE EN GÉNÉRAL

• COMME CHAQUE APPLICATION APPENGINE, AVEC PHP VOUS AVEZ DROIT A UN QUOTA
D’UTILISATION SUR LES OUTILS ET SERVICES DE GOOGLE, UNE FOIS CE QUOTAS FRANCHIS, VOUS
NE POUVEZ PLUS UTILISÉ LE DIT SERVICE, POUR LE FAIRE VOUS DEVEZ SOUSCRIRE DE NOUVEAU
• A LA CRÉATION DE VOTRE APPLICATION, VOUS DÉFINISSEZ LES QUOTAS POUR CHAQUE SERVICES
INSTALLATION DU PHP SDK APPENGINE
• L’EXÉCUTION D’APPENGINE SUR PHP NÉCESSITE D’AVOIR AU PRÉABLE PYTHON SUR SA
MACHINE, DE CE FAIT POUR INSTALLER LE PHP SDK VOUS PROCUREZ LES OUTILS SUIVANTS :
• PYTHON
• PHP
• APACHE
• MYSQL

• APPENGINE POUR PHP
INSTALLATION DU PHP SDK APPENGINE
• TÉLÉCHARGEZ ET INSTALLEZ LA VERSION DE PYTHON CORRESPONDANTE A VOTRE SYSTÈME (
DE PRÉFÉRENCE LA 2.7 )
• CONFIGUREZ L’ENVIRONNEMENT PYTHON SUR VOTRE MACHINE EN AJOUTANT A LA VARIABLE
SYSTÈME LE RÉPERTOIRE VERS VOTRE INSTALLATION DE PYTHON ( C:/PYTHON27 )
• OUVREZ L’INVITE DE COMMANDE ET TAPEZ PYTHON, SI TOUT ES OK, VOUS VERREZ LA
VERSION ET VOUS AUREZ AUSSI L’INTERPRÉTEUR PYTHON
• UNE FOIS PYTHON INSTALLÉ, INSTALLÉ AUSSI MYSQL, ET APACHE
INSTALLATION DU PHP SDK APPENGINE
• L’INSTALLATION DE PHP N’EST PAS NÉCESSAIRE CAR APPENGINE EMBARQUE UNE VERSION DE
PHP, MAIS RIEN N’EMPÊCHE D’INSTALLER PHP INDÉPENDAMMENT DE APPENGINE
• PROCÉDEZ MAINTENANT À L’INSTALLATION D’APPENGINE QUE VOUS VENEZ DE TÉLÉCHARGEZ
• UNE FOIS CELA FAIT, VOTRE ENVIRONNEMENT APPENGINE EST OPÉRATIONNEL ET VOUS
POUVEZ DES A PRÉSENT COMMENCER A CRÉER VOS APPLICATIONS
EXÉCUTION DE NOTRE APPLICATION APPENGINE
• UNE FOIS NOTRE APPLICATION APPENGINE CRÉE, NOUS AVONS LE FICHIER APP.YAML QUI NOUS
DONNE LES INFOS DE BASES DE NOTRE APPLICATION ( VERSION, EXÉCUTEUR, NOM DE
L’APPLICATION, FICHIERS STATIQUES, RÉPERTOIRES IMAGES, … )
• POUR EXÉCUTER NOTRE APPLICATION APPENGINE, NOUS ALLONS EN LIGNE DE COMMANDE ET
EXÉCUTONS LA COMMANDE SUIVANTE : PATH_GOOGLE_APPENGINE/DEV_APPSERVER.PY PATH-TOYOUR-APP OU GOOGLE_APPENGINE/DEV_APPSERVER.PY --PORT=NUM_PORT PATH-TO-YOUR-APP
SI LE PORT PAR DEFAUT (8080) EST OCCUPÉE
• POUR ARRÉTER SON SERVEUR VOICE LES COMBINAISONS DE TOUCHES A FAIRE : CONTROL-C SOUS
MAC OU LINUX, ET CONTROL-BREAK SOUS WINDOWS

• VOUS POUVEZ AUSSI TESTER VOS APPLICATIONS VIA L’INTERFACE APPENGINE SANS UTILISER LA
LIGNE DE COMMANDE
APPENGINE ET PHP : BASE DE DONNÉES
• APPENGINE POUR PHP DISPOSE DE DEUX MOYENS DE GESTION DES DONNÉES, PLUS
EXACTEMENT 2 ARCHITECTURES DE BASE DE DONNÉES SONT PRISES EN CHARGE
• LES BASES DE DONNÉES RELATIONNELLES ET ICI ON FAIT APPEL A GOOGLE CLOUD SQL, IL
S’AGIT EN FAIT D’UNE BASE DE DONNÉES MYSQL DANS LE CLOUD
• LE DATASTORE, IL S’AGIT ICI D’UNE BASE DE DONNÉES NON RELATIONNELLES, CE TYPE
D’ARCHITECTURE EST AUSSI CONNUE SOUS LE NOM DE NO-SQL ( CELA NE VEUT PAS DIRE PAS
DE SQL, MAIS PLUTÔT NON A L’APPROCHE RELATIONNELLE DES BASES DE DONNÉES
CLASSIQUES )
APPENGINE ET PHP : BASE DE DONNÉES
• COMME DIT PLUTÔT, GOOGLE CLOUD SQL, C’EST MYSQL DANS LE CLOUD, DONC LES
REQUÊTES À UTILISER DANS VOTRE CODE SONT DES REQUÊTES SQL NORMALES, ON PEUT
AUSSI UTILISER DES OUTILS TEL PDO, OU ALORS FAIRE UNE CHAINE DE CONNEXION MYSQL
STANDARD

• POUR CEUX QUI DÉVELOPPENT LEUR APPLIS EN LOCALE, JE LEUR CONSEILLE DONC DE GREFFER
UNE BD MYSQL A LEUR PROJET, PUIS AU MOMENT DE DÉPLOYER L’APPLICATION SUR
APPENGINE, QU’IL FASSE UN EXPORT DE LEUR BD QU’IL IMPORTERONS SUR LA PLATEFORME
• ILS AURONT JUSTE A CHANGER LA CHAINE DE CONNEXION, POUR RAPPEL SUR APPENGINE
CHAQUE BD CORRESPOND À UNE INSTANCE DE GOOGLE CLOUD SQL
APPENGINE ET PHP : BASE DE DONNÉES
• JE PARTAGERAIS AVEC VOUS D’ICI PEU UN TUTO SUR COMMENT CRÉER ET CONFIGURER UNE
INSTANCE GOOGLE CLOUD SQL
• MAINTENANT, GOOGLE CLOUD SQL CONTRAIREMENT AU DATASTORE N’EST PAS GRATUIT, DE
CE FAIT POUR CRÉER VOTRE INSTANCE ON VOUS DEMANDERA LE NUMÉRO DE VOTRE CARTE
VISA
• LA FACTURATION EST DE L’ORDRE DE 12F/HEURE, VOUS N’ÊTES FACTURÉ QUE SI VOTRE
APPLICATION FAIT APPEL À L’INSTANCE GOOGLE CLOUD SQL
• L’AVANTAGE DE GOOGLE CLOUD SQL EST QU’IL EST ASSEZ FAMILIER A LA PLUPART DES
DÉVELOPPEURS CONTRAIREMENT AU DATASTORE
APPENGINE ET PHP : BASE DE DONNÉES
• LE DATASTORE EST L’AUTRE MOYEN DE STOCKAGE QUE PROPOSE APPENGINE, L’UTILISATION
PEUT S’AVÉRER TRÈS COMPLIQUER POUR LE DÉVELOPPEMENT PHP, EN JAVA ET PYTHON
L’UTILISATION SEMBLE PLUS SIMPLE
• LE DATASTORE COMME DIT PLUTÔT EST UN ARCHITECTURE DE BD NON RELATIONNELLE,
ARCHITECTURE CONNU SOUS LE NOM DE NO-SQL, LE NO-SQL PRÉCONISE QUE LES TABLES DE
LA BD N’ONT PAS UNE STRUCTURE RIGIDE, PAR EXEMPLE DANS UNE MÊME TABLE ON PEUT
AVOIR UN ENREGISTREMENT DE 3 VALEURS ET UN AUTRE ENREGISTREMENT DE 5 VALEURS,

• L’UTILISATION DU DATASTORE SE FAIT TOUJOURS VIA UNE INSTANCE

More Related Content

Similar to Google appengine avec php

PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgPHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgQuentin Adam
 
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services SingaporeKel
 
SRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at ScaleSRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at ScaleAmazon Web Services
 
Apidays efficient-131204080056-phpapp02
Apidays efficient-131204080056-phpapp02Apidays efficient-131204080056-phpapp02
Apidays efficient-131204080056-phpapp02Aravindharamanan S
 
Connect Your Clouds with Force.com
Connect Your Clouds with Force.comConnect Your Clouds with Force.com
Connect Your Clouds with Force.comJeff Douglas
 
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosAMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosKel
 
Using PHP with IBM Bluemix
Using PHP with IBM BluemixUsing PHP with IBM Bluemix
Using PHP with IBM Bluemixvvaswani
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqRuben Tan
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixDev_Events
 
ShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz
 
AMIMOTO: WordPress + Amazon Web Services MANILA
AMIMOTO: WordPress + Amazon Web Services MANILAAMIMOTO: WordPress + Amazon Web Services MANILA
AMIMOTO: WordPress + Amazon Web Services MANILAKel
 
JNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerJNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerBryson Tyrrell
 
Meetup OpenShift São Paulo
Meetup OpenShift São PauloMeetup OpenShift São Paulo
Meetup OpenShift São PauloGetup Cloud
 
WordPress + Amazon Web Services Hands-on WARSAW
WordPress + Amazon Web Services Hands-on WARSAWWordPress + Amazon Web Services Hands-on WARSAW
WordPress + Amazon Web Services Hands-on WARSAWMatt Pilarski
 
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW Kel
 
Firebase Authentication with Android
Firebase Authentication with AndroidFirebase Authentication with Android
Firebase Authentication with AndroidShabab Karim
 

Similar to Google appengine avec php (20)

PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourgPHP deploy 2015 flavor - talk from php tour 2015 luxembourg
PHP deploy 2015 flavor - talk from php tour 2015 luxembourg
 
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore2nd AMIMOTO: WordPress + Amazon Web Services Singapore
2nd AMIMOTO: WordPress + Amazon Web Services Singapore
 
Operating Your Production API
Operating Your Production APIOperating Your Production API
Operating Your Production API
 
SRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at ScaleSRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at Scale
 
Using OpenShift PaaS
Using OpenShift PaaSUsing OpenShift PaaS
Using OpenShift PaaS
 
Apidays efficient-131204080056-phpapp02
Apidays efficient-131204080056-phpapp02Apidays efficient-131204080056-phpapp02
Apidays efficient-131204080056-phpapp02
 
Connect Your Clouds with Force.com
Connect Your Clouds with Force.comConnect Your Clouds with Force.com
Connect Your Clouds with Force.com
 
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los BañosAMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
AMIMOTO: WordPress + Amazon Web Services University of the Philippines Los Baños
 
Using PHP with IBM Bluemix
Using PHP with IBM BluemixUsing PHP with IBM Bluemix
Using PHP with IBM Bluemix
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
Create and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and BluemixCreate and Manage APIs with API Connect, Swagger and Bluemix
Create and Manage APIs with API Connect, Swagger and Bluemix
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
ShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your Apps
 
AMIMOTO: WordPress + Amazon Web Services MANILA
AMIMOTO: WordPress + Amazon Web Services MANILAAMIMOTO: WordPress + Amazon Web Services MANILA
AMIMOTO: WordPress + Amazon Web Services MANILA
 
JNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution ServerJNUC 2017: Open Distribution Server
JNUC 2017: Open Distribution Server
 
Meetup OpenShift São Paulo
Meetup OpenShift São PauloMeetup OpenShift São Paulo
Meetup OpenShift São Paulo
 
WordPress + Amazon Web Services Hands-on WARSAW
WordPress + Amazon Web Services Hands-on WARSAWWordPress + Amazon Web Services Hands-on WARSAW
WordPress + Amazon Web Services Hands-on WARSAW
 
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW
AMIMOTO: WordPress + Amazon Web Services Hands-on WARSAW
 
Next Level Tech SEO | Dominik Wojcik | SEO Day 2017
Next Level Tech SEO | Dominik Wojcik | SEO Day 2017Next Level Tech SEO | Dominik Wojcik | SEO Day 2017
Next Level Tech SEO | Dominik Wojcik | SEO Day 2017
 
Firebase Authentication with Android
Firebase Authentication with AndroidFirebase Authentication with Android
Firebase Authentication with Android
 

Recently uploaded

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Recently uploaded (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Google appengine avec php

  • 1. GOOGLE APPENGINE AVEC PHP SUMBANG CHRISTIAN BAUREL SKYPE : TEMZY1988 TECHNICAL MANAGER GDG DOUALA FACEBOOK : SUMBANG CHRISTIAN BAUREL GOOGLE+ : SUMBANG CHRISTIAN BAUREL TWITTER : @CHRISTIANBAUREL
  • 2. LE DÉBUT DE L’AVENTURE : MAI 2013 • AU LANCEMENT DE LA PLATEFORME APPENGINE PHP N’ÉTAIT PAS PARMI LES LANGAGES SUPPORTÉS, JAVA D’AILLEURS N’ÉTAIT PAS PRISE EN CHARGE; SEUL PYTHON ÉTAIT SUPPORTÉS • QUELQUES ANNÉES PLU TARD JAVA A ÉTÉ PRISE EN CHARGE SUITE A LA FORTE DEMANDE DE LA COMMUNAUTÉ JAVA, PLUS TARD GO LE LANGAGE PROPRIÉTAIRE DE GOOGLE A LUI AUSSI ÉTÉ PRIS EN CHARGE PAR LA PLATEFORME • LA PRISE EN CHARGE DE PHP EST SURVENUE EN MAI DERNIER LORS DU GOOGLE IO, CERTES CETTE PRISE EN CHARGE EST ENCORE LIMITE PAR RAPPORT AU AUTRES LANGAGES TEL JAVA ET PYTHON
  • 3. APPENGINE ET PHP : L’UNION PARFAITE • POURQUOI UNION PARFAITE ? PHP EST LE LANGAGE WEB LE PLUS POPULAIRE ET LE PLUS UTILISÉ AU MONDE, APPENGINE EST UNE PLATEFORME D’HÉBERGEMENT CLOUD, NE PAS PROPOSER PHP COMME LANGAGE SUPPORTÉ PAR APPENGINE ÉTAIT INCOMPRÉHENSIBLE DE MON POINT DE VUE • AVEC LE SUPPORT DE PHP, APPENGINE S’OUVRE A UNE ÉNORME COMMUNAUTÉ DE DÉVELOPPEURS ET A DES MILLIONS D’APPLICATIONS POTENTIELS QUI Y SERONT HÉBERGÉES • LA PRISE EN CHARGE DE PHP EST ENCORE A SES DÉBUTS, MAIS TOUT ME LAISSE PENSER QUE D’ICI QUELQUES ANNÉES, ELLE SERA COMPLÈTE ET PARFAITEMENT UTILISABLE
  • 4. APPENGINE ET PHP : LES LIMITES ET RESTRICTIONS • COMME DIT, LA PRISE EN CHARGE DE PHP EST ENCORE AU STADE EMBRYONNAIRE, CERTAINES EXTENSIONS NE SONT PAS PRISE EN CHARGE, MAIS LE NÉCESSAIRE POUR LE DÉVELOPPEMENT EST ACTIF • PARMI LES EXTENSIONS PHP ACTIVES, ON RETROUVERA DES EXTENSIONS TEL : APC, BCMATCH, CORE, CALENDAR, CTYPE, DATE, DOM, EREG, FILTER, GD, HASH, ICONV, JSON, LIBXML, MBSTRING, MSCRIPT, MEMCACHE, MEMCACHED, MYSQL, MYSQLI, MSQLND, OAUTH, OPENSSL, PCRE, PDO, PDO_MYSQL, REFLECTION, SESSION, SHMOP, SIMPLEXML, SOAP, SPL, STANDARD, TOKENIZER, XML, XMLREADER, XMLREADER, ZLIB
  • 5. APPENGINE ET PHP : LIMITE ET RESTRICTIONS • CERTAINES FONCTIONNALITÉS DE PHP ONT ÉTÉ DÉSACTIVÉES POUR DES RAISONS DE SÉCURITÉ, CERTAINES PEUVENT ÊTRE ACTIVES AU BESOIN DANS LE FICHIER PHP.INI, ENTRE AUTRES ON A : DISK_FREE_SPACE(), DISK_TOTAL_SPACE(), DISKFREESPACE(), ESCAPESHELLARG() AND ESCAPESHELLCMD(), EXEC(), FSOCKOPEN(), GETHOSTNAME(), HIGHLIGHT_FILE(), LINK(), PASSTHRU(), POPEN(), PROC_CLOSE(), PROG_GET_STATUS(), PROC_NICE(), PROC_OPEN() AND PROC_TERMINATE(), SET_TIME_LIMIT(), SHELL_EXEC(), SHOW_SOURCE(), SYMLINK(), SYSTEM(), TMPFILE(), TEMPNAM()
  • 6. APPENGINE ET PHP : LIMITES ET RESTRICTIONS • IL EST POSSIBLE D’UTILISER DU CODE PHP DANS SES APP APPENGINE, MAIS CELA DOIT ÊTRE UNE SYNTAXE PUR PHP • DE MÊME IL EST POSSIBLE D’INTÉGRER HTML, JAVASCRIPT ET CSS DANS NOS APPLICATIONS APPENGINE, CONCERNANT JAVASCRIPT ET CSS NOUS DEVONS SIGNALER LEUR UTILISATION DANS LE FICHIER DE CONFIGURATION DE NOTRE APPLICATION (APP.YAML), NOUS REVIENDRONS SUR CE FICHIER PLUS TARD • LA VERSION DE PHP SUPPORTÉS POUR L’INSTANT EST LA 5.4, VOTRE APPLICATION DOIT DONC ÊTRE FAITE AU MINIMUM AVEC LA VERSION 5.4 DE PHP
  • 7. APPENGINE ET PHP : QUOTAS ET SANDBOX • LE SANDBOX SIGNIFIE BAC A SABLE EN FRANÇAIS, C’EST LE LIEU OU EST EXÉCUTÉ VOTRE APPLICATION APPENGINE, C’EST UN ESPACE DÉDIÉE À L’EXÉCUTION DE VOTRE APPLICATION SANS AUCUNE INCIDENCE SUR LES AUTRES APPLICATIONS HÉBERGÉES PAR APPENGINE OU SUR LA PLATEFORME APPENGINE EN GÉNÉRAL • COMME CHAQUE APPLICATION APPENGINE, AVEC PHP VOUS AVEZ DROIT A UN QUOTA D’UTILISATION SUR LES OUTILS ET SERVICES DE GOOGLE, UNE FOIS CE QUOTAS FRANCHIS, VOUS NE POUVEZ PLUS UTILISÉ LE DIT SERVICE, POUR LE FAIRE VOUS DEVEZ SOUSCRIRE DE NOUVEAU • A LA CRÉATION DE VOTRE APPLICATION, VOUS DÉFINISSEZ LES QUOTAS POUR CHAQUE SERVICES
  • 8. INSTALLATION DU PHP SDK APPENGINE • L’EXÉCUTION D’APPENGINE SUR PHP NÉCESSITE D’AVOIR AU PRÉABLE PYTHON SUR SA MACHINE, DE CE FAIT POUR INSTALLER LE PHP SDK VOUS PROCUREZ LES OUTILS SUIVANTS : • PYTHON • PHP • APACHE • MYSQL • APPENGINE POUR PHP
  • 9. INSTALLATION DU PHP SDK APPENGINE • TÉLÉCHARGEZ ET INSTALLEZ LA VERSION DE PYTHON CORRESPONDANTE A VOTRE SYSTÈME ( DE PRÉFÉRENCE LA 2.7 ) • CONFIGUREZ L’ENVIRONNEMENT PYTHON SUR VOTRE MACHINE EN AJOUTANT A LA VARIABLE SYSTÈME LE RÉPERTOIRE VERS VOTRE INSTALLATION DE PYTHON ( C:/PYTHON27 ) • OUVREZ L’INVITE DE COMMANDE ET TAPEZ PYTHON, SI TOUT ES OK, VOUS VERREZ LA VERSION ET VOUS AUREZ AUSSI L’INTERPRÉTEUR PYTHON • UNE FOIS PYTHON INSTALLÉ, INSTALLÉ AUSSI MYSQL, ET APACHE
  • 10. INSTALLATION DU PHP SDK APPENGINE • L’INSTALLATION DE PHP N’EST PAS NÉCESSAIRE CAR APPENGINE EMBARQUE UNE VERSION DE PHP, MAIS RIEN N’EMPÊCHE D’INSTALLER PHP INDÉPENDAMMENT DE APPENGINE • PROCÉDEZ MAINTENANT À L’INSTALLATION D’APPENGINE QUE VOUS VENEZ DE TÉLÉCHARGEZ • UNE FOIS CELA FAIT, VOTRE ENVIRONNEMENT APPENGINE EST OPÉRATIONNEL ET VOUS POUVEZ DES A PRÉSENT COMMENCER A CRÉER VOS APPLICATIONS
  • 11.
  • 12.
  • 13. EXÉCUTION DE NOTRE APPLICATION APPENGINE • UNE FOIS NOTRE APPLICATION APPENGINE CRÉE, NOUS AVONS LE FICHIER APP.YAML QUI NOUS DONNE LES INFOS DE BASES DE NOTRE APPLICATION ( VERSION, EXÉCUTEUR, NOM DE L’APPLICATION, FICHIERS STATIQUES, RÉPERTOIRES IMAGES, … ) • POUR EXÉCUTER NOTRE APPLICATION APPENGINE, NOUS ALLONS EN LIGNE DE COMMANDE ET EXÉCUTONS LA COMMANDE SUIVANTE : PATH_GOOGLE_APPENGINE/DEV_APPSERVER.PY PATH-TOYOUR-APP OU GOOGLE_APPENGINE/DEV_APPSERVER.PY --PORT=NUM_PORT PATH-TO-YOUR-APP SI LE PORT PAR DEFAUT (8080) EST OCCUPÉE • POUR ARRÉTER SON SERVEUR VOICE LES COMBINAISONS DE TOUCHES A FAIRE : CONTROL-C SOUS MAC OU LINUX, ET CONTROL-BREAK SOUS WINDOWS • VOUS POUVEZ AUSSI TESTER VOS APPLICATIONS VIA L’INTERFACE APPENGINE SANS UTILISER LA LIGNE DE COMMANDE
  • 14. APPENGINE ET PHP : BASE DE DONNÉES • APPENGINE POUR PHP DISPOSE DE DEUX MOYENS DE GESTION DES DONNÉES, PLUS EXACTEMENT 2 ARCHITECTURES DE BASE DE DONNÉES SONT PRISES EN CHARGE • LES BASES DE DONNÉES RELATIONNELLES ET ICI ON FAIT APPEL A GOOGLE CLOUD SQL, IL S’AGIT EN FAIT D’UNE BASE DE DONNÉES MYSQL DANS LE CLOUD • LE DATASTORE, IL S’AGIT ICI D’UNE BASE DE DONNÉES NON RELATIONNELLES, CE TYPE D’ARCHITECTURE EST AUSSI CONNUE SOUS LE NOM DE NO-SQL ( CELA NE VEUT PAS DIRE PAS DE SQL, MAIS PLUTÔT NON A L’APPROCHE RELATIONNELLE DES BASES DE DONNÉES CLASSIQUES )
  • 15. APPENGINE ET PHP : BASE DE DONNÉES • COMME DIT PLUTÔT, GOOGLE CLOUD SQL, C’EST MYSQL DANS LE CLOUD, DONC LES REQUÊTES À UTILISER DANS VOTRE CODE SONT DES REQUÊTES SQL NORMALES, ON PEUT AUSSI UTILISER DES OUTILS TEL PDO, OU ALORS FAIRE UNE CHAINE DE CONNEXION MYSQL STANDARD • POUR CEUX QUI DÉVELOPPENT LEUR APPLIS EN LOCALE, JE LEUR CONSEILLE DONC DE GREFFER UNE BD MYSQL A LEUR PROJET, PUIS AU MOMENT DE DÉPLOYER L’APPLICATION SUR APPENGINE, QU’IL FASSE UN EXPORT DE LEUR BD QU’IL IMPORTERONS SUR LA PLATEFORME • ILS AURONT JUSTE A CHANGER LA CHAINE DE CONNEXION, POUR RAPPEL SUR APPENGINE CHAQUE BD CORRESPOND À UNE INSTANCE DE GOOGLE CLOUD SQL
  • 16. APPENGINE ET PHP : BASE DE DONNÉES • JE PARTAGERAIS AVEC VOUS D’ICI PEU UN TUTO SUR COMMENT CRÉER ET CONFIGURER UNE INSTANCE GOOGLE CLOUD SQL • MAINTENANT, GOOGLE CLOUD SQL CONTRAIREMENT AU DATASTORE N’EST PAS GRATUIT, DE CE FAIT POUR CRÉER VOTRE INSTANCE ON VOUS DEMANDERA LE NUMÉRO DE VOTRE CARTE VISA • LA FACTURATION EST DE L’ORDRE DE 12F/HEURE, VOUS N’ÊTES FACTURÉ QUE SI VOTRE APPLICATION FAIT APPEL À L’INSTANCE GOOGLE CLOUD SQL • L’AVANTAGE DE GOOGLE CLOUD SQL EST QU’IL EST ASSEZ FAMILIER A LA PLUPART DES DÉVELOPPEURS CONTRAIREMENT AU DATASTORE
  • 17. APPENGINE ET PHP : BASE DE DONNÉES • LE DATASTORE EST L’AUTRE MOYEN DE STOCKAGE QUE PROPOSE APPENGINE, L’UTILISATION PEUT S’AVÉRER TRÈS COMPLIQUER POUR LE DÉVELOPPEMENT PHP, EN JAVA ET PYTHON L’UTILISATION SEMBLE PLUS SIMPLE • LE DATASTORE COMME DIT PLUTÔT EST UN ARCHITECTURE DE BD NON RELATIONNELLE, ARCHITECTURE CONNU SOUS LE NOM DE NO-SQL, LE NO-SQL PRÉCONISE QUE LES TABLES DE LA BD N’ONT PAS UNE STRUCTURE RIGIDE, PAR EXEMPLE DANS UNE MÊME TABLE ON PEUT AVOIR UN ENREGISTREMENT DE 3 VALEURS ET UN AUTRE ENREGISTREMENT DE 5 VALEURS, • L’UTILISATION DU DATASTORE SE FAIT TOUJOURS VIA UNE INSTANCE