Skip to content

Commit dc5d1d0

Browse files
bshafferTakashi Matsuo
authored andcommitted
Revert env flex in master (GoogleCloudPlatform#216)
* Revert "update analytics sample for env:flex (GoogleCloudPlatform#210)" This reverts commit 6d15221. * Revert "updates cloudsql sample to env:flex (GoogleCloudPlatform#211)" This reverts commit 8490b7e.
1 parent 8490b7e commit dc5d1d0

File tree

11 files changed

+154
-334
lines changed

11 files changed

+154
-334
lines changed

appengine/flexible/analytics/app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
runtime: php
2-
env: flex
2+
vm: true
33

44
runtime_config:
5-
document_root: web
5+
document_root: web

appengine/flexible/analytics/tests/DeployTest.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

appengine/flexible/analytics/tests/LocalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
namespace Google\Cloud\Samples\AppEngine\Analytics;
17+
namespace Google\Cloud\Test;
1818

1919
use Silex\WebTestCase;
2020

appengine/flexible/cloudsql/README.md

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,43 @@ composer install
1919

2020
Before you can run or deploy the sample, you will need to do the following:
2121

22-
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:
22+
1. Create a [First 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:
2323

24-
$ gcloud beta sql instances create YOUR_INSTANCE_NAME --tier=db-f1-micro --activation-policy=ALWAYS
24+
$ gcloud sql instances create YOUR_INSTANCE_NAME
2525

26-
> Note: the `--tier` option is required to create a `Second Generation` instance. See the
27-
full list of available tiers by running `gcloud sql tiers list`
28-
29-
2. Set the root password on your Cloud SQL instance:
26+
1. Set the root password on your Cloud SQL instance:
3027

3128
$ gcloud sql instances set-root-password YOUR_INSTANCE_NAME --password YOUR_INSTANCE_ROOT_PASSWORD
3229

33-
3. Install and run the [CloudSQL Proxy](https://cloud.google.com/sql/docs/mysql-connect-proxy)
30+
1. Update the connection string in `app.yaml` with your configuration values. These values are used when the application is deployed.
3431

35-
4. Create a database for this example
32+
## Run locally
3633

37-
$ mysql -h 127.0.0.1 -u root -p -e "CREATE DATABASE ;"
34+
To run locally, you can either run your own MySQL server locally and set the connection string in `app.yaml`, or you can [connect to your CloudSQL instance externally](https://cloud.google.com/sql/docs/external#appaccess).
3835

36+
```sh
37+
cd php-docs-samples/appengine/standard/cloudsql
3938

40-
## Deploy to App Engine
39+
# set local mysql connection parameters
40+
export MYSQL_DSN="mysql:host=127.0.0.1;port=3306;dbname=guestbook"
41+
export MYSQL_USERNAME=root
42+
export MYSQL_PASSWORD=
4143

42-
**Prerequisites**
44+
php -S localhost:8080
45+
```
4346

44-
- Install the [Google Cloud SDK](https://developers.google.com/cloud/sdk/).
47+
> be sure the `MYSQL_` environment variables are appropriate for your mysql instance
4548
46-
**Deploy with gcloud**
49+
Now you can view the app running at [http://localhost:8080](http://localhost:8080)
50+
in your browser.
4751

48-
1. Update `app.yaml` with the configuration values for `USER`, `PASSWORD`, and
49-
`DATABASE` with the values you used during setup.
52+
## Deploy to App Engine
5053

51-
1. Get the CloudSQL connection name
54+
**Prerequisites**
5255

53-
$ gcloud beta sql instances describe YOUR_INSTANCE_NAME | grep connectionName
56+
- Install the [Google Cloud SDK](https://developers.google.com/cloud/sdk/).
5457

55-
1. Update `app.yaml` with the configuration value for `CONNECTION_NAME` you retrieved
56-
at the end up setup.
58+
**Deploy with gcloud**
5759

5860
```
5961
gcloud config set project YOUR_PROJECT_ID
@@ -63,28 +65,3 @@ gcloud app browse
6365

6466
The last command will open `https://{YOUR_PROJECT_ID}.appspot.com/`
6567
in your browser.
66-
67-
## Run locally
68-
69-
1. Ensure the [CloudSQL Proxy](https://cloud.google.com/sql/docs/external#proxy) is
70-
installed and running.
71-
72-
1. Set the following environment variables with the configuration values for
73-
`USER`, `PASSWORD`, and `DATABASE` you used during setup:
74-
75-
```sh
76-
# set local mysql connection parameters
77-
export MYSQL_DSN="mysql:host=127.0.0.1;port=3306;dbname=DATABASE"
78-
export MYSQL_USERNAME=USER
79-
export MYSQL_PASSWORD=PASSWORD
80-
```
81-
82-
1. Run the application
83-
84-
```sh
85-
cd php-docs-samples/appengine/standard/cloudsql
86-
php -S localhost:8080
87-
```
88-
89-
Now you can view the app running at [http://localhost:8080](http://localhost:8080)
90-
in your browser.

appengine/flexible/cloudsql/app.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
runtime: php
2-
env: flex
2+
vm: true
33

4-
#[START env]
5-
env_variables:
6-
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
7-
# values obtained when configuring your Cloud SQL instance.
8-
MYSQL_DSN: mysql:dbname=DATABASE;unix_socket=/cloudsql/CONNECTION_NAME
9-
MYSQL_USER: USER
10-
MYSQL_PASSWORD: PASSWORD
11-
#[END env]
12-
13-
#[START cloudsql_settings]
14-
# Use the connection name obtained when configuring your Cloud SQL instance.
15-
beta_settings:
16-
cloud_sql_instances: "CONNECTION_NAME"
17-
#[END cloudsql_settings]
4+
runtime_config:
5+
document_root: web

appengine/flexible/cloudsql/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
},
66
"require-dev": {
77
"google/cloud-tools": "<=1.0",
8-
"paragonie/random_compat": "^2.0",
98
"phpunit/phpunit": "~4"
109
}
1110
}

0 commit comments

Comments
 (0)