Skip to content

Commit 78c47fd

Browse files
committed
WIP
1 parent db02acd commit 78c47fd

16 files changed

+147
-0
lines changed

appengine/php72/scripts/.gcloudignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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/

appengine/php72/scripts/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://getcomposer.org/doc/articles/scripts.md

appengine/php72/scripts/app.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
runtime: php72
2+
3+
env_variables:
4+
BRENT_ENV: "app.yaml is where this is defined"
5+

appengine/php72/scripts/brent.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "IT's BRENT";

appengine/php72/scripts/brent.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
runtime: php72
2+
3+
entrypoint: serve brent.php
4+
5+
env_variables:
6+
BRENT_ENV: "brent.yaml is where this is defined"
7+

appengine/php72/scripts/composer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"scripts": {
3+
"post-update-cmd": [
4+
"echo POST-UPDATE-CMD"
5+
],
6+
"pre-update-cmd": [
7+
"echo PRE-UPDATE-CMD"
8+
],
9+
"post-install-cmd": [
10+
"echo POST-INSTALL-CMD"
11+
],
12+
"pre-install-cmd": [
13+
"echo PRE-INSTALL-CMD"
14+
],
15+
"post-status-cmd": [
16+
"echo POST-STATUS-CMD"
17+
],
18+
"pre-archive-cmd": [
19+
"echo PRE-ARCHIVE-CMD"
20+
],
21+
"post-archive-cmd": [
22+
"echo POST-ARCHIVE-CMD"
23+
],
24+
"pre-autoload-dump": [
25+
"echo PRE-AUTOLOAD-DUMP"
26+
],
27+
"post-autoload-dump": [
28+
"echo POST-AUTOLOAD-DUMP",
29+
"php post_update_cmd.php",
30+
"# pecl install swoole",
31+
"# cp /usr/lib/php/extensions/no-debug-non-zts-20170718/swoole.so .",
32+
"pecl install swoole",
33+
"gcloud kms decrypt --location=global --keyring=ci --key=ci --ciphertext-file=secrets.txt.enc --plaintext-file=secrets.txt"
34+
],
35+
"pre-dependency-solving": [
36+
"echo PRE-DEPENDENCY-SOLVING"
37+
],
38+
"post-dependency-solving": [
39+
"echo POST-DEPENDENCY-SOLVING"
40+
],
41+
"pre-package-install": [
42+
"echo PRE-PACKAGE-INSTALL"
43+
],
44+
"post-package-install": [
45+
"echo POST-PACKAGE-INSTALL"
46+
],
47+
"pre-package-update": [
48+
"echo PRE-PACKAGE-UPDATE"
49+
],
50+
"post-package-update": [
51+
"echo POST-PACKAGE-UPDATE"
52+
],
53+
"on-appengine-deploy": [
54+
"echo POST-PACKAGE-UPDATE"
55+
]
56+
}
57+
}

appengine/php72/scripts/index.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
3+
echo "Scripts Test!
"
;
4+
5+
echo "is /usr/lib/php/extensions/no-debug-non-zts-20170718 a dir?
"
;
6+
var_dump($exists = file_exists('/usr/lib/php/extensions/no-debug-non-zts-20170718'));
7+
8+
if ($exists) {
9+
exec('ln -s /usr/lib/php/extensions/no-debug-non-zts-20170718', $output);
10+
var_dump($output);
11+
}
12+
13+
echo "decrypted file exists?
"
;
14+
var_dump(file_exists('secrets.txt'));
15+
var_dump(file_get_contents('secrets.txt'));
16+
17+
echo "extension loaded?
"
;
18+
var_dump(extension_loaded('swoole'));
19+
20+
echo "extension exists?
"
;
21+
var_dump(file_exists('swoole.so'));
22+
23+
echo "
"
;
24+
// var_dump(file_exists(__DIR__ . '/test.txt'));
25+
26+
// var_dump(file_get_contents(__DIR__ . '/test.txt'));
27+
28+
// var_dump(getenv('BRENT_ENV'));
29+
30+
phpinfo();

appengine/php72/scripts/php.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
;extension=swoole.so
2+
;extension=/usr/lib/php/extensions/no-debug-non-zts-20170718/swoole.so
3+
;extension=/workspace/swoole.so
4+
extension=swoole.so

appengine/php72/scripts/php_local.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extension="swoole.so"
2+
extension_dir=/Library/WebServer/Code/php-docs-samples/appengine/php72/scripts
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "Post-Install Command\n";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "Post-Status Command\n";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
echo "Post-Update Command\n";
4+
5+
file_put_contents(__DIR__ . '/test.txt', 'This text was added by your friendly ' . __FILE__);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "Pre-Install Command\n";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "Pre-Status Command\n";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo "Pre-Update Command\n";
102 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)