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
};

0 commit comments

Comments
 (0)