Skip to content

Commit eed0aee

Browse files
authored
README Updates for App Engine BETA (GoogleCloudPlatform#660)
1 parent 6dfaf30 commit eed0aee

File tree

14 files changed

+134
-129
lines changed

14 files changed

+134
-129
lines changed

appengine/php72/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# App Engine for PHP 7.2
22

3-
*Please note ALL samples in this directory are in ALPHA*
3+
> Please note ALL samples in this directory are in `BETA`
44
5-
[Sign up](https://goo.gl/qpQg5k ) to get alpha access.
5+
[Read the docs](https://cloud.google.com/appengine/docs/standard/php7)
66

7+
## Getting Started Guides
8+
9+
* [Quickstart](https://cloud.google.com/appengine/docs/standard/php7/quickstart)
10+
* [Building an App](https://cloud.google.com/appengine/docs/standard/php7/building-app/)
11+
12+
## Code Samples
13+
14+
* [Implementing `Google Auth`](auth)
15+
* [Connecting to `Cloud SQL`](cloudsql)
16+
* [Enabling `Cloud Error Reporting`](errorreporting)
17+
* [Implementing a `front controller`](front-controller)
18+
* [Making `gRPC` calls](grpc)
19+
* [Using the `Metadata` server](metadata)
20+
* [Using `Cloud Storage`](storage)
21+
* [Enabling `Cloud Trace`](trace)
22+
23+
## Framework Guides
24+
25+
* [Laravel](laravel-framework)
26+
* [Slim Framework](slim-framework)
27+
* [Symfony](symfony-framework)
28+
* [WordPress](wordpress)

appengine/php72/auth/README.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
1-
# Google Auth PHP Sample Application
1+
# Google Auth on App Engine Standard for PHP 7.2
22

3-
[![Open in Cloud Shell][shell_img]][shell_link]
4-
5-
[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
6-
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googlecloudplatform/php-docs-samples&page=editor&working_dir=auth
3+
This sample application demonstrates how to [Authenticate Users](https://cloud.google.com/appengine/docs/standard/php7/authenticating-users)
4+
on App Engine Standard.
75

86
## Description
97

10-
This command-line application shows how to authenticate to Google Cloud APIs
11-
using different methods. This sample uses Storage as an example, but these
12-
methods will work on any Google Cloud API.
8+
This application shows how to authenticate to Google Cloud APIs using two
9+
different methods. This sample uses Storage as an example, but these methods
10+
will work for any Google Cloud API.
11+
12+
## Deploy to App Engine
1313

14-
## Build and Run
1514
1. **Enable APIs** - [Enable the Storage API](https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com)
1615
and create a new project or select an existing project.
17-
2. **Download The Credentials** - Click "Go to credentials" after enabling the APIs. Click "New Credentials"
18-
and select "Service Account Key". Create a new service account, use the JSON key type, and
19-
select "Create". Once downloaded, set the environment variable `GOOGLE_APPLICATION_CREDENTIALS`
20-
to the path of the JSON key that was downloaded.
21-
3. **Clone the repo** and cd into this directory
22-
```
16+
1. **Clone the repo** and cd into this directory
17+
```
2318
$ git clone https://github.com/GoogleCloudPlatform/php-docs-samples
24-
$ cd php-docs-samples/auth
25-
```
26-
4. **Install dependencies** via [Composer](http://getcomposer.org/doc/00-intro.md).
27-
Run `php composer.phar install --no-dev` (if composer is installed locally) or `composer install --no-dev`
28-
(if composer is installed globally).
29-
5. Run `gcloud app deploy` to deploy to App Engine.
30-
31-
## Contributing changes
32-
33-
* See [CONTRIBUTING.md](../CONTRIBUTING.md)
34-
35-
## Licensing
36-
37-
* See [LICENSE](../LICENSE)
19+
$ cd php-docs-samples/appengine/php72/auth
20+
```
21+
1. **Install dependencies** via [Composer](http://getcomposer.org/doc/00-intro.md).
22+
Run `php composer.phar install --no-dev` (if composer is installed locally)
23+
or `composer install --no-dev` (if composer is installed globally).
24+
1. Run `gcloud app deploy` to deploy to App Engine.
25+
26+
## Run Locally
27+
28+
1. **Download The Credentials** - Click "Go to credentials" after enabling the
29+
APIs. Click "New Credentials" and select "Service Account Key". Create a new
30+
service account, use the JSON key type, and select "Create". Once
31+
downloaded, set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to
32+
the path of the JSON key that was downloaded.
33+
1. Run PHP's built-in web server with the command `php -S localhost:8000` and
34+
then view the application in your browser at
35+
[http://localhost:8000](http://localhost:8000).

appengine/php72/cloudsql/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# Cloud SQL & Google App Engine
1+
# Cloud SQL on App Engine Standard for PHP 7.2
22

3-
This sample application demonstrates how to use [Cloud SQL with Google App Engine](https://cloud.google.com/appengine/docs/php/cloud-sql/).
3+
This sample application demonstrates how to use [Cloud SQL on App Engine for PHP 7.2](https://cloud.google.com/appengine/docs/standard/php7/using-cloud-sql).
44

55
## Setup
66

77
Before you can run or deploy the sample, you will need to do the following:
88

9-
1. Create a [Second Generation Cloud SQL](https://cloud.google.com/sql/docs/create-instance) instance. You can do this from the [Cloud Console](https://console.developers.google.com) or via the [Cloud SDK](https://cloud.google.com/sdk). To create it via the SDK use the following command:
9+
1. Create a [Second Generation Cloud SQL](https://cloud.google.com/sql/docs/create-instance)
10+
instance. You can do this from the [Cloud Console](https://console.developers.google.com)
11+
or via the [Cloud SDK](https://cloud.google.com/sdk). To create it via the
12+
SDK use the following command:
1013

1114
$ gcloud sql instances create YOUR_INSTANCE_NAME
1215

appengine/php72/errorreporting/README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# App Engine for PHP 7.2 Error Reporting samples
1+
# Stackdriver Error Reporting on App Engine Standard for PHP 7.2
22

3-
This app demonstrates how to report errors on App Engine for PHP 7.2 and shows how
4-
different PHP error types are handled.
3+
This application demonstrates how to report errors on App Engine Standard for
4+
PHP 7.2. It also demonstrates how different PHP error types are handled.
55

66
To set up **error reporting** in your App Engine PHP 7.2 application, simply follow
77
these two steps:
@@ -10,7 +10,7 @@ these two steps:
1010
```sh
1111
composer require google/cloud-error-reporting
1212
```
13-
2. Create a [`php.ini`](php.ini) file in the root of your project and set
13+
1. Create a [`php.ini`](php.ini) file in the root of your project and set
1414
`auto_prepend_file` to the following:
1515
```ini
1616
; in php.ini
@@ -22,25 +22,48 @@ registers the client library's error handler.
2222
2323
[prepend]: https://github.com/GoogleCloudPlatform/google-cloud-php-errorreporting/blob/master/src/prepend.php
2424
25-
## Setup
25+
If you cannot modify your `php.ini`, the `prepend.php` file can be manually
26+
included to register the error handler:
27+
28+
```php
29+
# This works for files in the root of your project. Adjust __DIR__ accordingly.
30+
require_once __DIR__ . '/vendor/google/cloud-error-reporting/src/prepend.php';
31+
```
32+
33+
## Setup the sample
2634
2735
- Install [`composer`](https://getcomposer.org)
2836
- Install dependencies by running:
29-
3037
```sh
3138
composer install
3239
```
33-
3440
- Install the [Google Cloud SDK](https://developers.google.com/cloud/sdk/).
3541
36-
## Deploy
42+
## Deploy the sample
43+
44+
### Deploy with `gcloud`
45+
46+
Deploy the samples by doing the following:
47+
48+
```
49+
gcloud config set project YOUR_PROJECT_ID
50+
gcloud app deploy
51+
gcloud app browse
52+
```
53+
54+
The last command will open `https://{YOUR_PROJECT_ID}.appspot.com/`
55+
in your browser. Browse to `/` to see a list of examples to execute.
3756
3857
### Run Locally
3958
40-
You can run the sample locally using PHP's build-in web server:
59+
Uncomment the `require_once` statement at the top of [`index.php`](index.php),
60+
or add the `auto_prepend_file` above to your local `php.ini`.
61+
62+
Now run the sample locally using PHP's build-in web server:
4163

4264
```
43-
# export environemnt variables locally which are set by app engine when deployed
65+
# export environemnt variables locally which are set by App Engine when deployed
66+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
4467
export GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
4568
export GAE_SERVICE=local
4669
export GAE_VERSION=testing
@@ -50,16 +73,3 @@ php -S localhost:8000
5073
```
5174
5275
Browse to `localhost:8000` to see a list of examples to execute.
53-
54-
### Deploy with gcloud
55-
56-
Deploy the samples by doing the following:
57-
58-
```
59-
gcloud config set project YOUR_PROJECT_ID
60-
gcloud app deploy
61-
gcloud app browse
62-
```
63-
64-
The last command will open `https://{YOUR_PROJECT_ID}.appspot.com/`
65-
in your browser. Browse to `/` to see a list of examples to execute.

appengine/php72/errorreporting/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#
1111
# [END gae_erroreporting_register_handler]
1212

13+
# Uncomment this line if you'd like to include `prepend.php` manually instead of
14+
# using `php.ini`:
15+
#
16+
# require_once 'vendor/google/cloud-error-reporting/src/prepend.php';
17+
#
1318
// throw a test exception to trigger our exception handler
1419
if (isset($_GET['type'])) {
1520
$linkText = '

This should now be visible in the '

appengine/php72/front-controller/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# App Engine for PHP 7.2 Front Controller sample
1+
# Front Controllers on App Engine Standard for PHP 7.2
22

33
This app demonstrates how to implement a simple front controller for legacy
4-
projects. The main code sample lies in [`index.php`](index.php#L13). This is one
4+
projects. The main code sample is in [`index.php`](index.php#L13). This is one
55
example of a front controller. See here for more examples:
66

77
* [front controller implementation using the Slim Framework](../slim-framework/index.php#L26)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Getting Started on App Engine for PHP 7.2
22

3-
This application is meant to help run a small PHP application which integrates with Cloud SQL and Cloud Storage on App Engine Standard for PHP 7.2. The tutorial uses the Slim framework.
3+
This sample demonstrates how to deploy a PHP application which integrates with
4+
Cloud SQL and Cloud Storage on App Engine Standard for PHP 7.2. The tutorial
5+
uses the Slim framework.
6+
7+
## View the [full tutorial](https://cloud.google.com/appengine/docs/standard/php7/building-app/)

appengine/php72/helloworld/README.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
1-
# Hello World on App Engine for PHP 7.2
1+
# Hello World on App Engine Standard for PHP 7.2
22

33
This sample demonstrates how to deploy a *very* basic application to Google
44
App Engine for PHP 7.2.
55

6-
## Setup
7-
8-
Before running this sample:
9-
10-
### Create a project (if you haven't already)
11-
12-
- Go to
13-
[Google Developers Console](https://console.developers.google.com/project)
14-
and create a new project.
15-
16-
## Deploy to App Engine
17-
18-
**Deploy with gcloud**
19-
20-
```
21-
gcloud config set project YOUR_PROJECT_ID
22-
gcloud app deploy
23-
gcloud app browse
24-
```
25-
26-
The last command will open `https://{YOUR_PROJECT_ID}.appspot.com/`
27-
in your browser.
6+
## View the [full tutorial](https://cloud.google.com/appengine/docs/standard/php7/quickstart)

appengine/php72/laravel-framework/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Laravel on App Engine for PHP 7.2
2-
=================================
1+
# Laravel Framework on App Engine Standard for PHP 7.2
32

43
[Laravel][laravel] is an open source web framework for PHP developers that encourages the use of the model-view-controller (MVC) pattern.
54

@@ -65,7 +64,7 @@ laravel.com. This version was tested to work with `laravel/laravel-framework:^5.
6564

6665
![Laravel welcome page][laravel-welcome]
6766

68-
## Set up Database Sessions
67+
## Set up Database Sessions with Cloud SQL
6968

7069
**Note**: This section only works with Laravel 5.4.16. To use earlier versions of
7170
Laravel, you need to manually add the `DB_SOCKET` value to
@@ -103,7 +102,7 @@ Laravel, you need to manually add the `DB_SOCKET` value to
103102
export DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=YOUR_DB_PASSWORD
104103
php artisan migrate --force
105104

106-
1. Modify your `app.yaml` file with the following contents:
105+
1. Modify your `app.yaml` file with contents from [`app-dbsessions.yaml`](app-dbsessions.yaml):
107106

108107
runtime: php72
109108

appengine/php72/laravel-framework/test/DeployDatabaseSessionTest.php renamed to appengine/php72/laravel-framework/test/DeployDatabaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Google\Cloud\TestUtils\TestTrait;
2222
use PHPUnit\Framework\TestCase;
2323

24-
class DeployDatabaseSessionTest extends TestCase
24+
class DeployDatabaseTest extends TestCase
2525
{
2626
use TestTrait;
2727
use DeployLaravelTrait;

appengine/php72/slim-framework/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Slim Example for App Engine for PHP 7.2
1+
# Slim Framework on App Engine for PHP 7.2
22

33
This sample demonstrates how to deploy a *very* basic [Slim][slim] application to
44
[Google App Engine for PHP 7.2][appengine-php]. For a more complete guide, follow
5-
the [getting started](../getting-started) tutorial.
5+
the [Building an App][building-an-app] tutorial.
66

77
## Setup
88

@@ -40,3 +40,4 @@ for PHP 7.2 require use of a [front controller][front-controller] file.
4040
[slim]: https://www.slimframework.com/
4141
[appengine-php]: https://cloud.google.com/appengine/docs/standard/php/
4242
[front-controller]: https://stackoverflow.com/questions/6890200/what-is-a-front-controller-and-how-is-it-implemented-in-php
43+
[building-an-app]: https://cloud.google.com/appengine/docs/standard/php7/building-app/

appengine/php72/storage/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Cloud Storage & Google App Engine
1+
# Cloud Storage on App Engine Standard for PHP 7.2
22

3-
This sample application demonstrates how to use [Cloud Storage with Google App Engine](https://cloud.google.com/appengine/docs/php/googlestorage/).
3+
This sample application demonstrates how to use [Cloud Storage on App Engine for PHP 7.2](https://cloud.google.com/appengine/docs/standard/php7/using-cloud-storage).
44

55
## Setup
66

appengine/php72/trace/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# App Engine for PHP 7.2 Stackdriver Trace samples
1+
# Stackdriver Trace on App Engine Standard for PHP 7.2
22

3-
This app demonstrates how to set up Stackdriver Trace on App Engine for PHP 7.2.
3+
This app demonstrates how to set up Stackdriver Trace on App Engine Standard
4+
for PHP 7.2.
45

56
## Setup
67

0 commit comments

Comments
 (0)