File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
appengine/standard/mailgun Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 20
20
$ app = new Application ();
21
21
22
22
$ app ->get ('/ ' , function () use ($ app ) {
23
- if ($ app ['mailgun.domain ' ] == 'MAILGUN_DOMAIN_NAME ' ) {
23
+ if ($ app ['mailgun.domain ' ] == 'MAILGUN_DOMAIN ' ) {
24
24
return 'set your mailgun domain and API key in index.php
' ;
25
25
}
26
26
Original file line number Diff line number Diff line change 22
22
$ app = require __DIR__ . '/app.php ' ;
23
23
24
24
// set your Mailgun domain name and API key
25
- $ app ['mailgun.domain ' ] = 'MAILGUN_DOMAIN_NAME ' ;
25
+ $ app ['mailgun.domain ' ] = 'MAILGUN_DOMAIN ' ;
26
26
$ app ['mailgun.api_key ' ] = 'MAILGUN_APIKEY ' ;
27
27
28
28
// Run the app!
Original file line number Diff line number Diff line change @@ -23,21 +23,29 @@ class DeployAppEngineFlexTest extends \PHPUnit_Framework_TestCase
23
23
{
24
24
use AppEngineDeploymentTrait;
25
25
26
- public function beforeDeploy ()
26
+ public static function beforeDeploy ()
27
27
{
28
+ // set your Mailgun domain name and API key
29
+ $ mailgunDomain = getenv ('MAILGUN_DOMAIN ' );
30
+ $ mailgunApiKey = getenv ('MAILGUN_APIKEY ' );
31
+
32
+ if (empty ($ mailgunDomain ) || empty ($ mailgunApiKey )) {
33
+ self ::markTestSkipped ('set the MAILGUN_DOMAIN and MAILGUN_APIKEY environment variables ' );
34
+ }
35
+
28
36
$ tmpDir = FileUtil::cloneDirectoryIntoTmp (__DIR__ . '/.. ' );
29
37
FileUtil::copyDir (__DIR__ . '/../../../flexible/mailgun ' , $ tmpDir );
30
38
self ::$ gcloudWrapper ->setDir ($ tmpDir );
31
39
chdir ($ tmpDir );
32
40
$ indexPhp = file_get_contents ('index.php ' );
33
41
$ indexPhp = str_replace (
34
- 'MAILGUN_DOMAIN_NAME ' ,
35
- getenv ( ' MAILGUN_DOMAIN_NAME ' ) ,
42
+ 'MAILGUN_DOMAIN ' ,
43
+ $ mailgunDomain ,
36
44
$ indexPhp
37
45
);
38
46
$ indexPhp = str_replace (
39
47
'MAILGUN_APIKEY ' ,
40
- getenv ( ' MAILGUN_APIKEY ' ) ,
48
+ $ mailgunApiKey ,
41
49
$ indexPhp
42
50
);
43
51
file_put_contents ('index.php ' , $ indexPhp );
You can’t perform that action at this time.
0 commit comments