File tree Expand file tree Collapse file tree 13 files changed +1988
-10
lines changed Expand file tree Collapse file tree 13 files changed +1988
-10
lines changed Original file line number Diff line number Diff line change 19
19
use Google \Cloud \TestUtils \AppEngineDeploymentTrait ;
20
20
use PHPUnit \Framework \TestCase ;
21
21
22
- require_once __DIR__ . '/../../../../testing/FileUtil.php ' ;
23
-
24
22
class DeployTest extends TestCase
25
23
{
26
24
use AppEngineDeploymentTrait;
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ This app demonstrates how to report errors on on App Engine for PHP 7.2.
17
17
18
18
# ## Run Locally
19
19
20
- These samples cannot be run locally with the Dev AppServer because gRPC has not
21
- been packaged with the Dev AppServer for PHP at this time. You can install gRPC
22
- locally and run them using PHP' s build-in web server:
20
+ You can run the sample locally using PHP' s build-in web server:
23
21
24
22
```
25
23
# export environemnt variables locally which are set by app engine when deployed
@@ -31,6 +29,8 @@ export GAE_VERSION=testing
31
29
php -S localhost:8000
32
30
```
33
31
32
+ Browse to ` localhost:8000 ` to see a list of examples to execute.
33
+
34
34
### Deploy with gcloud
35
35
36
36
Deploy the samples by doing the following:
Original file line number Diff line number Diff line change 24
24
25
25
use PHPUnit \Framework \TestCase ;
26
26
27
- require_once __DIR__ . '/../../../../testing/FileUtil.php ' ;
28
-
29
27
class DeployTest extends TestCase
30
28
{
31
29
use AppEngineDeploymentTrait;
Original file line number Diff line number Diff line change 1
1
# Hello World on App Engine for PHP 7.2
2
2
3
- This sample application demonstrates how to access
4
- [ Compute Metadata] ( https://cloud.google.com/compute/docs/storing-retrieving-metadata )
5
- from App Engine.
3
+ This sample demonstrates how to deploy a * very* basic application to Google
4
+ App Engine for PHP 7.2.
6
5
7
6
## Setup
8
7
Original file line number Diff line number Diff line change
1
+ # This file specifies files that are *not* uploaded to Google Cloud Platform
2
+ # using gcloud. It follows the same syntax as .gitignore, with the addition of
3
+ # "#!include" directives (which insert the entries of the given .gitignore-style
4
+ # file at that point).
5
+ #
6
+ # For more information, run:
7
+ # $ gcloud topic gcloudignore
8
+ #
9
+ .gcloudignore
10
+ # If you would like to upload your .git directory, .gitignore file or files
11
+ # from your .gitignore file, remove the corresponding line
12
+ # below:
13
+ .git
14
+ .gitignore
15
+
16
+ # PHP Composer dependencies:
17
+ #vendor/
Original file line number Diff line number Diff line change
1
+ # App Engine for PHP 7.2 Stackdriver Trace samples
2
+
3
+ This app demonstrates how to set up Stackdriver Trace on App Engine for PHP 7.2.
4
+
5
+ ## Setup
6
+
7
+ - Install [ ` composer ` ] ( https://getcomposer.org )
8
+ - Install dependencies by running:
9
+
10
+ ``` sh
11
+ composer install
12
+ ```
13
+
14
+ - Install the [Google Cloud SDK](https://developers.google.com/cloud/sdk/).
15
+
16
+ # # Deploy
17
+
18
+ # ## Run Locally
19
+
20
+ You can run these samples locally using PHP' s build-in web server:
21
+
22
+ ```
23
+ # export environemnt variables locally which are set by app engine when deployed
24
+ export GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
25
+
26
+ # Run PHP' s built-in web server
27
+ php -S localhost:8000
28
+ ```
29
+
30
+ You will then be able to see your application traces in the
31
+ [ Trace UI] ( https://console.cloud.google.com/traces/overview ) .
32
+
33
+ ### Deploy with gcloud
34
+
35
+ Deploy the samples by doing the following:
36
+
37
+ ```
38
+ gcloud config set project YOUR_PROJECT_ID
39
+ gcloud app deploy
40
+ gcloud app browse
41
+ ```
42
+
43
+ The last command will open ` https://{YOUR_PROJECT_ID}.appspot.com/ `
44
+ in your browser. Browse to ` / ` to execute a trace. You will then be able to see
45
+ your traces in the [ Trace UI] ( https://console.cloud.google.com/traces/overview ) .
Original file line number Diff line number Diff line change
1
+ runtime : php72
2
+
3
+ handlers :
4
+ - url : /
5
+ script : index.php
Original file line number Diff line number Diff line change
1
+ {
2
+ "require" : {
3
+ "opencensus/opencensus-exporter-stackdriver" : " ^0.1.0"
4
+ },
5
+ "require-dev" : {
6
+ "google/cloud-tools" : " ^0.7"
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments