Skip to content

Commit 465ff98

Browse files
averikitschbshaffer
authored andcommitted
update region tags (GoogleCloudPlatform#670)
1 parent 0590a19 commit 465ff98

File tree

20 files changed

+59
-69
lines changed

20 files changed

+59
-69
lines changed

appengine/flexible/analytics/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/** @var Twig_Environment $twig */
3030
$twig = $app['twig'];
3131
$trackingId = $app['GA_TRACKING_ID'];
32-
# [START track_event]
32+
# [START gae_flex_analytics_track_event]
3333
$baseUri = 'http://www.google-analytics.com/';
3434
$client = new GuzzleHttp\Client(['base_uri' => $baseUri]);
3535
$formData = [
@@ -45,7 +45,7 @@
4545
'ev' => 0, # Event value, must be an integer
4646
];
4747
$response = $client->request('POST', 'collect', ['form_params' => $formData]);
48-
# [END track_event]
48+
# [END gae_flex_analytics_track_event]
4949
return $twig->render('index.html.twig', [
5050
'base_uri' => $baseUri,
5151
'response_code' => $response->getStatusCode(),

appengine/flexible/analytics/app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ env: flex
44
runtime_config:
55
document_root: .
66

7-
# [START env_variables]
7+
# [START gae_flex_analytics_env_variables]
88
env_variables:
99
GA_TRACKING_ID: "YOUR-GA-TRACKING-ID"
10-
# [END env_variables]
10+
# [END gae_flex_analytics_env_variables]

appengine/flexible/cloudsql-mysql/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
# [START example]
18+
# [START gae_flex_mysql_app]
1919
use Silex\Application;
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\HttpFoundation\Response;
@@ -71,6 +71,6 @@
7171
return new Response(implode("\n", $visits), 200,
7272
['Content-Type' => 'text/plain']);
7373
});
74-
# [END example]
74+
# [END gae_flex_mysql_app]
7575

7676
return $app;

appengine/flexible/cloudsql-mysql/app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ env: flex
44
runtime_config:
55
document_root: .
66

7-
#[START env]
7+
#[START gae_flex_mysql_env]
88
env_variables:
99
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
1010
# values obtained when configuring your Cloud SQL instance.
1111
MYSQL_USER: USER
1212
MYSQL_PASSWORD: PASSWORD
1313
MYSQL_DSN: mysql:dbname=DATABASE;unix_socket=/cloudsql/CONNECTION_NAME
14-
#[END env]
14+
#[END gae_flex_mysql_env]
1515

16-
#[START cloudsql_settings]
16+
#[START gae_flex_mysql_settings]
1717
# Use the connection name obtained when configuring your Cloud SQL instance.
1818
beta_settings:
1919
cloud_sql_instances: "CONNECTION_NAME"
20-
#[END cloudsql_settings]
20+
#[END gae_flex_mysql_settings]

appengine/flexible/cloudsql-postgres/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
# [START example]
18+
# [START gae_flex_postgres_app]
1919
use Silex\Application;
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\HttpFoundation\Response;
@@ -71,6 +71,6 @@
7171
return new Response(implode("\n", $visits), 200,
7272
['Content-Type' => 'text/plain']);
7373
});
74-
# [END example]
74+
# [END gae_flex_postgres_app]
7575

7676
return $app;

appengine/flexible/cloudsql-postgres/app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ env: flex
44
runtime_config:
55
document_root: .
66

7-
#[START env]
7+
#[START gae_flex_postgres_env]
88
env_variables:
99
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
1010
# values obtained when configuring your Cloud SQL instance.
1111
POSTGRES_USER: USER
1212
POSTGRES_PASSWORD: PASSWORD
1313
POSTGRES_DSN: pgsql:dbname=DATABASE;host=/cloudsql/CONNECTION_NAME
14-
#[END env]
14+
#[END gae_flex_postgres_env]
1515

16-
#[START cloudsql_settings]
16+
#[START gae_flex_postgres_settings]
1717
# Use the connection name obtained when configuring your Cloud SQL instance.
1818
beta_settings:
1919
cloud_sql_instances: "CONNECTION_NAME"
20-
#[END cloudsql_settings]
20+
#[END gae_flex_postgres_settings]

appengine/flexible/datastore/app.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525

2626
$app['datastore'] = function () use ($app) {
2727
$projectId = $app['project_id'];
28-
# [START create_client]
28+
# [START gae_flex_datastore_client]
2929
$datastore = new DatastoreClient([
3030
'projectId' => $projectId
3131
]);
32-
# [END create_client]
32+
# [END gae_flex_datastore_client]
3333
return $datastore;
3434
};
3535

@@ -43,17 +43,17 @@
4343
// determine the user's IP
4444
$user_ip = get_user_ip($request);
4545

46-
# [START insert_entity]
46+
# [START gae_flex_datastore_entity]
4747
// Create an entity to insert into datastore.
4848
$key = $datastore->key('visit');
4949
$entity = $datastore->entity($key, [
5050
'user_ip' => $user_ip,
5151
'timestamp' => new DateTime(),
5252
]);
5353
$datastore->insert($entity);
54-
# [END insert_entity]
54+
# [END gae_flex_datastore_entity]
5555

56-
# [START run_query]
56+
# [START gae_flex_datastore_query]
5757
// Query recent visits.
5858
$query = $datastore->query()
5959
->kind('visit')
@@ -66,7 +66,7 @@
6666
$entity['timestamp']->format('Y-m-d H:i:s'),
6767
$entity['user_ip']);
6868
}
69-
# [END run_query]
69+
# [END gae_flex_datastore_query]
7070
array_unshift($visits, "Last 10 visits:");
7171
return new Response(implode("\n", $visits), 200,
7272
['Content-Type' => 'text/plain']);

appengine/flexible/logging/app.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
return 'Set the GOOGLE_PROJECT_ID environment variable to run locally';
3434
}
3535
$projectId = $app['project_id'];
36-
# [START list_entries]
3736
$logging = new LoggingClient([
3837
'projectId' => $projectId
3938
]);
@@ -42,22 +41,21 @@
4241
'pageSize' => 10,
4342
'orderBy' => 'timestamp desc'
4443
]);
45-
# [END list_entries]
4644
return $app['twig']->render('index.html.twig', ['logs' => $logs]);
4745
});
4846

4947
$app->post('/log', function (Request $request) use ($app) {
5048
$projectId = $app['project_id'];
5149
$text = $request->get('text');
52-
# [START write_log]
50+
# [START gae_flex_configure_logging]
5351
# [START creating_psr3_logger]
5452
$logging = new LoggingClient([
5553
'projectId' => $projectId
5654
]);
5755
$logger = $logging->psrLogger('app');
5856
# [END creating_psr3_logger]
5957
$logger->notice($text);
60-
# [END write_log]
58+
# [END gae_flex_configure_logging]
6159
return $app->redirect('/');
6260
});
6361

appengine/flexible/mailgun/app.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
$mailgunDomain,
5353
$mailgunApiKey
5454
) {
55-
# [START simple_message]
55+
# [START gae_flex_mailgun_simple_message]
5656
// Instantiate the client.
5757
$httpClient = new Http\Adapter\Guzzle6\Client();
5858
$mailgunClient = new Mailgun\Mailgun($mailgunApiKey, $httpClient);
@@ -64,7 +64,7 @@
6464
'subject' => 'Hello',
6565
'text' => 'Testing some Mailgun awesomeness!',
6666
));
67-
# [END simple_message]
67+
# [END gae_flex_mailgun_simple_message]
6868
return $result;
6969
});
7070

@@ -75,7 +75,7 @@
7575
7676
7777
) {
78-
# [START complex_message]
78+
# [START gae_flex_mailgun_complex_message]
7979
// Instantiate the client.
8080
$httpClient = new Http\Adapter\Guzzle6\Client();
8181
$mailgunClient = new Mailgun\Mailgun($mailgunApiKey, $httpClient);
@@ -93,7 +93,7 @@
9393
), array(
9494
'attachment' => array($fileAttachment, $fileAttachment),
9595
));
96-
# [END complex_message]
96+
# [END gae_flex_mailgun_complex_message]
9797
return $result;
9898
});
9999

appengine/flexible/mailjet/app.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
$mailjet = $app['mailjet'];
4242
$recipient = $request->get('recipient');
4343

44-
# [START send_email]
44+
# [START gae_flex_mailjet_send_message]
4545
$body = [
4646
'FromEmail' => "[email protected]",
4747
'FromName' => "Testing Mailjet",
@@ -66,7 +66,7 @@
6666
}
6767

6868
return 'Error: ' . print_r($response->getStatus(), true);
69-
# [END send_email]
69+
# [END gae_flex_mailjet_send_message]
7070
});
7171

7272
$app['mailjet'] = function () use ($app) {
@@ -76,9 +76,9 @@
7676
$mailjetApiKey = $app['mailjet.api_key'];
7777
$mailjetSecret = $app['mailjet.secret'];
7878

79-
# [START mailjet_client]
79+
# [START gae_flex_mailjet_config]
8080
$mailjet = new Mailjet\Client($mailjetApiKey, $mailjetSecret);
81-
# [END mailjet_client]
81+
# [END gae_flex_mailjet_config]
8282

8383
return $mailjet;
8484
};

appengine/flexible/memcache/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
$username = getenv('MEMCACHE_USERNAME');
3636
$password = getenv('MEMCACHE_PASSWORD');
37-
# [START memcached]
37+
# [START gae_flex_redislabs_memcache]
3838
// $host = 'YOUR_MEMCACHE_HOST';
3939
// $port = 'YOUR_MEMCACHE_PORT';
4040
// $username = 'OPTIONAL_MEMCACHE_USERNAME';
@@ -47,7 +47,7 @@
4747
if (!$memcached->addServer($host, $port)) {
4848
throw new Exception("Failed to add server $host:$port");
4949
}
50-
# [END memcached]
50+
# [END gae_flex_redislabs_memcache]
5151
return $memcached;
5252
};
5353

appengine/flexible/memcache/app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vm: true
44
runtime_config:
55
document_root: web
66

7-
# [START env_variables]
7+
# [START gae_flex_redislabs_memcache_yaml]
88
env_variables:
99
# If you are using the App Engine Memcache service (currently in alpha),
1010
# uncomment this section and comment out the other Memcache variables.
@@ -14,4 +14,4 @@ env_variables:
1414
# fill in these values with your username and password.
1515
MEMCACHE_USERNAME: ""
1616
MEMCACHE_PASSWORD: ""
17-
# [END env_variables]
17+
# [END gae_flex_redislabs_memcache_yaml]

appengine/flexible/sendgrid/app.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
18+
# [START gae_flex_sendgrid]
1719
use Silex\Application;
1820
use Symfony\Component\HttpFoundation\Request;
1921
use Symfony\Component\HttpFoundation\Response;
@@ -37,7 +39,6 @@
3739
$sendgridSender = $app['sendgrid.sender'];
3840
$sendgridApiKey = $app['sendgrid.api_key'];
3941
$sendgridRecipient = $request->get('recipient');
40-
# [START send_mail]
4142
// $sendgridApiKey = 'YOUR_SENDGRID_APIKEY';
4243
// $sendgridSender = '[email protected]';
4344
// $sendgridRecipient = '[email protected]';
@@ -49,11 +50,11 @@
4950
// send the email
5051
$sendgrid = new SendGrid($sendgridApiKey);
5152
$response = $sendgrid->client->mail()->send()->post($mail);
52-
# [END send_mail]
5353
if ($response->statusCode() < 200 || $response->statusCode() >= 300) {
5454
return new Response($response->body(), $response->statusCode());
5555
}
5656
return 'Email sent.';
5757
});
5858

5959
return $app;
60+
# [END gae_flex_sendgrid]

appengine/flexible/sendgrid/app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ env: flex
44
runtime_config:
55
document_root: .
66

7-
# [START env_variables]
7+
# [START gae_flex_sendgrid_yaml]
88
env_variables:
99
SENDGRID_APIKEY: your-sendgrid-api-key
1010
SENDGRID_SENDER: your-sendgrid-sender
11-
# [END env_variables]
11+
# [END gae_flex_sendgrid_yaml]

appengine/flexible/storage/app.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
# [START app]
19-
# [START import_client]
18+
# [START gae_flex_storage_app]
2019
use Google\Cloud\Storage\StorageClient;
21-
# [END import_client]
2220
use Silex\Application;
2321
use Symfony\Component\HttpFoundation\Request;
2422

@@ -59,25 +57,21 @@
5957
$bucketName = $app['bucket_name'];
6058
$objectName = $app['object_name'];
6159
$content = $request->get('content');
62-
# [START write]
6360
$metadata = ['contentType' => 'text/plain'];
6461
$storage->bucket($bucketName)->upload($content, [
6562
'name' => $objectName,
6663
'metadata' => $metadata,
6764
]);
68-
# [END write]
6965
return $app->redirect('/');
7066
});
7167

7268
$app['storage'] = function () use ($app) {
7369
$projectId = $app['project_id'];
74-
# [START create_client]
7570
$storage = new StorageClient([
7671
'projectId' => $projectId
7772
]);
78-
# [END create_client]
7973
return $storage;
8074
};
81-
# [END app]
75+
# [END gae_flex_storage_app]
8276

8377
return $app;

appengine/flexible/storage/app.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ env: flex
44
runtime_config:
55
document_root: .
66

7-
# [START env_variables]
7+
# [START gae_flex_storage_yaml]
88
env_variables:
99
GOOGLE_STORAGE_BUCKET: "your-bucket-name"
10-
# [END env_variables]
11-
10+
# [END gae_flex_storage_yaml]

0 commit comments

Comments
 (0)