gae for php - google cloud sql and cloud storage
TRANSCRIPT
![Page 1: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/1.jpg)
Storing Data
http://goo.gl/5KZ3AQ
![Page 2: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/2.jpg)
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
![Page 3: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/3.jpg)
![Page 4: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/4.jpg)
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
![Page 5: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/5.jpg)
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
![Page 6: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/6.jpg)
Creating a Cloud SQL Instance
![Page 7: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/7.jpg)
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
![Page 8: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/8.jpg)
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
![Page 9: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/9.jpg)
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
![Page 10: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/10.jpg)
Grant your App Engine applicationStep 1
Step 2
Step 3
![Page 11: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/11.jpg)
Build a starter application and database1. Create your App Engine sample application
○ Hello GAE!
2. Grant your App Engine application access to
the Google Cloud SQL instance
3. Create your database and table
![Page 12: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/12.jpg)
Create your database and table1. Connecting MySQL
● Use the MySQL command-line tool
● Sequel Pro
2. Create database and table
![Page 13: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/13.jpg)
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
![Page 14: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/14.jpg)
Connect to your database
1. Using PHP common connection methods
PDO_MySQL, mysqli, MySQL API
2. Test Example (http://goo.gl/b2YkmD)
3. Update your configuration file
4. Deployment!
![Page 15: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/15.jpg)
Using Google Cloud SQL with App Engine PHP SDK1. Creating a Cloud SQL instance
2. Build a starter application and database
3. Connect to your database
4. Size and access limits
![Page 16: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/16.jpg)
Size and access limits
60 seconds
HTTP request timer
10 mimutes
Offline requests & Backend requests
![Page 17: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/17.jpg)
Storing Data
● Enable Billing
● Using Google Cloud SQL
● Google Cloud Storage
![Page 18: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/18.jpg)
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
![Page 19: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/19.jpg)
Reading and Writing File
Two ways to write files to GSC
1. Write files from your app
● Simple file write
● Streamed file write
2. Let the user upload files to GCS
![Page 20: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/20.jpg)
Writing files from your app
gs://bucket_name/desired_object_name
You can obtain a default bucket for it by clicking
Create within the Cloud Integration section in
the Application Settings page of the App
Engine Admin Console
![Page 21: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/21.jpg)
Simple file write
Streamed file write
http://goo.gl/LZESqj
![Page 22: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/22.jpg)
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
![Page 23: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/23.jpg)
Publically Accessible Files
Create a public-readable file containing some
random numbers, writing it to a GCS bucket,
and redirect to that file form GCS.
![Page 24: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/24.jpg)
Example
![Page 25: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/25.jpg)
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
![Page 26: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/26.jpg)
User Uploads
Create the applicaton specific upload URL, using the method
CloudStorageTools::createUploadUrl()You must start uploading to this URL within 10 minutes of its creation.Use this URL as the action for the form you use to accept uploads.
![Page 27: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/27.jpg)
Example
![Page 28: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/28.jpg)
Google Cloud Storage
● Reading and Writing Files
● Publically Accessible Files
● User Uploads
● Serving Images
![Page 29: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/29.jpg)
Serving Images
CloudStorageTools.getImageServingUrl()CloudStorageTools.deleteImageServingUrl()
![Page 30: GAE for PHP - Google Cloud SQL and Cloud Storage](https://reader033.vdocument.in/reader033/viewer/2022051516/55a40ac81a28abd35e8b47cf/html5/thumbnails/30.jpg)
My Github example
http://goo.gl/zQkq5U