Skip to content

Commit 4796efc

Browse files
authored
Merge branch 'master' into ace-n-patch-2
2 parents 59463fe + 7ec7717 commit 4796efc

File tree

342 files changed

+6592
-1166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+6592
-1166
lines changed

.kokoro/secrets-example.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export POSTGRES_DSN=
6060
export POSTGRES_DATABASE=
6161
export POSTGRES_USER=
6262
export POSTGRES_PASSWORD=
63+
export SQLSERVER_DSN=
64+
export SQLSERVER_DATABASE=
65+
export SQLSERVER_USER=
66+
export SQLSERVER_PASSWORD=
67+
export DB_SOCKET_DIR=
6368

6469
# Datastore
6570
export CLOUD_DATASTORE_NAMESPACE=

.kokoro/secrets.sh.enc

4 Bytes
Binary file not shown.

.php-cs-fixer.dist.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@
1616
'return_type_declaration' => [
1717
'space_before' => 'none'
1818
],
19+
// only converts simple strings in double quotes to single quotes
20+
// ignores strings using variables, escape characters or single quotes inside
21+
'single_quote' => true,
22+
// there should be a single space b/w the cast and it's operand
23+
'cast_spaces' => ['space' => 'single'],
24+
// there shouldn't be any trailing whitespace at the end of a non-blank line
25+
'no_trailing_whitespace' => true,
26+
// there shouldn't be any trailing whitespace at the end of a blank line
27+
'no_whitespace_in_blank_line' => true,
28+
// there should be a space around binary operators like (=, => etc)
29+
'binary_operator_spaces' => ['default' => 'single_space'],
30+
// deals with rogue empty blank lines
31+
'no_extra_blank_lines' => ['tokens' => ['extra']],
32+
// reduces multi blank lines b/w phpdoc description and @param to a single line
33+
// NOTE: Doesn't add a blank line if none exist
34+
'phpdoc_trim_consecutive_blank_line_separation' => true,
1935
])
2036
->setFinder(
2137
PhpCsFixer\Finder::create()

analyticsdata/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/analytics-data": "^0.5.0"
3+
"google/analytics-data": "^0.7.0"
44
}
55
}

analyticsdata/quickstart_json_credentials.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
*/
4444
$property_id = 'YOUR-GA4-PROPERTY-ID';
4545

46-
4746
// [START analyticsdata_json_credentials_initialize]
4847
/* TODO(developer): Replace this variable with a valid path to the
4948
* credentials.json file for your service account downloaded from the
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/analytics-data": "^0.5.0",
3+
"google/analytics-data": "^0.7.0",
44
"ext-bcmath": "*"
55
}
66
}

appengine/flexible/datastore/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
$entity['user_ip']);
7373
}
7474
# [END gae_flex_datastore_query]
75-
array_unshift($visits, "Last 10 visits:");
75+
array_unshift($visits, 'Last 10 visits:');
7676
$response->getBody()->write(implode("\n", $visits));
7777

7878
return $response

appengine/flexible/datastore/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function testIndex()
3030
$this->assertEquals('200', $resp->getStatusCode(),
3131
'top page status code');
3232

33-
$this->assertStringContainsString("Last 10 visits:", (string) $resp->getBody());
33+
$this->assertStringContainsString('Last 10 visits:', (string) $resp->getBody());
3434
}
3535
}

appengine/flexible/datastore/test/LocalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function testIndex()
3333
$response = $app->handle($request);
3434
$this->assertEquals(200, $response->getStatusCode());
3535
$text = (string) $response->getBody();
36-
$this->assertStringContainsString("Last 10 visits:", $text);
36+
$this->assertStringContainsString('Last 10 visits:', $text);
3737
}
3838
}

appengine/flexible/logging/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testIndex()
4141
$this->assertEquals('200', $resp->getStatusCode(),
4242
'top page status code');
4343

44-
$this->assertStringContainsString("Logs:", (string) $resp->getBody());
44+
$this->assertStringContainsString('Logs:', (string) $resp->getBody());
4545
}
4646
public function testAsyncLog()
4747
{

appengine/flexible/logging/test/LocalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testSomeLogs()
3333

3434
$this->assertEquals(200, $response->getStatusCode());
3535
$text = (string) $response->getBody();
36-
$this->assertStringContainsString("Logs:", $text);
36+
$this->assertStringContainsString('Logs:', $text);
3737
}
3838

3939
public function testAsyncLog()

appengine/flexible/memcache/test/DeployTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public function testIndex()
5050
$key = rand(0, 1000);
5151

5252
// Test the /memcached REST API.
53-
$this->put("/memcached/test$key", "sour");
54-
$this->assertEquals("sour", $this->get("/memcached/test$key"));
55-
$this->put("/memcached/test$key", "sweet");
56-
$this->assertEquals("sweet", $this->get("/memcached/test$key"));
53+
$this->put("/memcached/test$key", 'sour');
54+
$this->assertEquals('sour', $this->get("/memcached/test$key"));
55+
$this->put("/memcached/test$key", 'sweet');
56+
$this->assertEquals('sweet', $this->get("/memcached/test$key"));
5757

5858
// Make sure it handles a POST request too, which will increment the
5959
// counter.

appengine/flexible/memcache/test/LocalTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ public function testGetAndPut()
6262
// Use a random key to avoid colliding with simultaneous tests.
6363

6464
// Test the /memcached REST API.
65-
$request1 = (new RequestFactory)->createRequest('PUT', "/memcached/testkey1");
65+
$request1 = (new RequestFactory)->createRequest('PUT', '/memcached/testkey1');
6666
$request1->getBody()->write('sour');
6767
$response1 = $app->handle($request1);
6868
$this->assertEquals(200, (string) $response1->getStatusCode());
6969

7070
// Check that the key was written as expected
71-
$request2 = (new RequestFactory)->createRequest('GET', "/memcached/testkey1");
71+
$request2 = (new RequestFactory)->createRequest('GET', '/memcached/testkey1');
7272
$response2 = $app->handle($request2);
73-
$this->assertEquals("sour", (string) $response2->getBody());
73+
$this->assertEquals('sour', (string) $response2->getBody());
7474

7575
// Test the /memcached REST API with a new value.
76-
$request3 = (new RequestFactory)->createRequest('PUT', "/memcached/testkey2");
76+
$request3 = (new RequestFactory)->createRequest('PUT', '/memcached/testkey2');
7777
$request3->getBody()->write('sweet');
7878
$response3 = $app->handle($request3);
7979
$this->assertEquals(200, (string) $response3->getStatusCode());
8080

8181
// Check that the key was written as expected
82-
$request4 = (new RequestFactory)->createRequest('GET', "/memcached/testkey2");
82+
$request4 = (new RequestFactory)->createRequest('GET', '/memcached/testkey2');
8383
$response4 = $app->handle($request4);
84-
$this->assertEquals("sweet", (string) $response4->getBody());
84+
$this->assertEquals('sweet', (string) $response4->getBody());
8585
}
8686
}
8787

appengine/flexible/twilio/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
$app->addErrorMiddleware(true, true, true);
2929

3030
$twilioAccountSid = getenv('TWILIO_ACCOUNT_SID');
31-
$twilioAuthToken = getenv('TWILIO_AUTH_TOKEN');
31+
$twilioAuthToken = getenv('TWILIO_AUTH_TOKEN');
3232
$twilioNumber = getenv('TWILIO_FROM_NUMBER');
3333

3434
# [START gae_flex_twilio_receive_call]

appengine/flexible/websockets/socket-demo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function onOpen(ConnectionInterface $conn)
4242

4343
public function onMessage(ConnectionInterface $from, $msg)
4444
{
45-
$output = "Message received: " . $msg . "\n";
45+
$output = 'Message received: ' . $msg . "\n";
4646
echo $output;
4747
foreach ($this->clients as $client) {
4848
$client->send($output);
@@ -59,7 +59,7 @@ public function onClose(ConnectionInterface $conn)
5959
public function onError(ConnectionInterface $conn, \Exception $e)
6060
{
6161
$conn->close();
62-
echo "Connection closed due to error: " . $e->getMessage() . "\n";
62+
echo 'Connection closed due to error: ' . $e->getMessage() . "\n";
6363
echo "\t" . $this->clients->count() . " connection(s) active.\n";
6464
}
6565
}

appengine/flexible/websockets/test/LocalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ public function testIndex()
5454
return $endPromise;
5555
})
5656
->otherwise(function ($e) {
57-
echo "Error: " . $e->getMessage() . "\n";
57+
echo 'Error: ' . $e->getMessage() . "\n";
5858
throw $e;
5959
});
6060

6161
$this->loop->run();
6262
$resolvedMsg = Block\await($basePromise, $this->loop);
6363
$this->assertStringContainsString(
64-
"Message received: Hello World!",
64+
'Message received: Hello World!',
6565
strval($resolvedMsg)
6666
);
6767
}

appengine/flexible/wordpress/files/wp-config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
* You can have multiple installations in one database if you give each
9898
* a unique prefix. Only numbers, letters, and underscores please!
9999
*/
100-
$table_prefix = 'wp_';
100+
$table_prefix = 'wp_';
101101

102102
/**
103103
* For developers: WordPress debugging mode.

appengine/standard/errorreporting/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function throwException()
4343
print('Triggering a PHP Fatal Error by including a file with a syntax error.');
4444
print($linkText);
4545
$filename = tempnam(sys_get_temp_dir(), 'php_syntax_error');
46-
file_put_contents($filename, "");
46+
file_put_contents($filename, '');
4747
require($filename);
4848
break;
4949
default:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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/
18+
19+
# Files from phpize
20+
ext/Makefile.global
21+
ext/acinclude.m4
22+
ext/aclocal.m4
23+
ext/autom4te.cache/
24+
ext/config.guess
25+
ext/config.h.in
26+
ext/config.sub
27+
ext/configure
28+
ext/configure.ac
29+
ext/install-sh
30+
ext/ltmain.sh
31+
ext/missing
32+
ext/mkinstalldirs
33+
ext/run-tests.php
34+
35+
# Files from ./configure
36+
ext/Makefile
37+
ext/Makefile.fragments
38+
ext/Makefile.objects
39+
ext/config.h
40+
ext/config.log
41+
ext/config.nice
42+
ext/config.status
43+
ext/libtool
44+
45+
# Files from make
46+
ext/.libs/
47+
ext/modules/
48+
ext/*.la
49+
ext/*.lo
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Files from phpize
2+
ext/Makefile.global
3+
ext/acinclude.m4
4+
ext/aclocal.m4
5+
ext/autom4te.cache/
6+
ext/config.guess
7+
ext/config.h.in
8+
ext/config.sub
9+
ext/configure
10+
ext/configure.ac
11+
ext/install-sh
12+
ext/ltmain.sh
13+
ext/missing
14+
ext/mkinstalldirs
15+
ext/run-tests.php
16+
17+
# Files from ./configure
18+
ext/Makefile
19+
ext/Makefile.fragments
20+
ext/Makefile.objects
21+
ext/config.h
22+
ext/config.log
23+
ext/config.nice
24+
ext/config.status
25+
ext/libtool
26+
27+
# Files from make
28+
ext/.libs/
29+
ext/modules/
30+
ext/*.la
31+
ext/*.lo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runtime: php74
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"scripts": {
3+
"post-autoload-dump": [
4+
"cd ext && phpize --clean && phpize && ./configure && make",
5+
"cp ext/modules/my_custom_extension.so vendor/"
6+
]
7+
}
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PHP_ARG_ENABLE(my_custom_extension, Whether to enable the MyCustomExtension extension, [ --enable-my-custom-extension Enable MyCustomExtension])
2+
3+
if test "$MY_CUSTOM_EXTENSION" != "no"; then
4+
PHP_NEW_EXTENSION(my_custom_extension, my_custom_extension.c, $ext_shared)
5+
fi
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// include the PHP API itself
2+
#include
3+
// include the extension header
4+
#include "my_custom_extension.h"
5+
6+
// register the "helloworld_from_extension" function to the PHP API
7+
zend_function_entry my_custom_extension_functions[] = {
8+
PHP_FE(helloworld_from_extension, NULL)
9+
{NULL, NULL, NULL}
10+
};
11+
12+
// some information about our module
13+
zend_module_entry my_custom_extension_module_entry = {
14+
STANDARD_MODULE_HEADER,
15+
PHP_MY_CUSTOM_EXTENSION_EXTNAME,
16+
my_custom_extension_functions,
17+
NULL,
18+
NULL,
19+
NULL,
20+
NULL,
21+
NULL,
22+
PHP_MY_CUSTOM_EXTENSION_VERSION,
23+
STANDARD_MODULE_PROPERTIES
24+
};
25+
26+
// use a macro to output additional C code, to make ext dynamically loadable
27+
ZEND_GET_MODULE(my_custom_extension)
28+
29+
// Implement our "Hello World" function, which returns a string
30+
PHP_FUNCTION(helloworld_from_extension) {
31+
zval val;
32+
ZVAL_STRING(&val, "Hello World! (from my_custom_extension.so)\n");
33+
RETURN_STR(Z_STR(val));
34+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// module constants
2+
#define PHP_MY_CUSTOM_EXTENSION_EXTNAME "my_custom_extension"
3+
#define PHP_MY_CUSTOM_EXTENSION_VERSION "0.0.1"
4+
5+
// the function to be exported
6+
PHP_FUNCTION(helloworld_from_extension);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo helloworld_from_extension();

appengine/standard/extensions/php.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extension=/workspace/vendor/my_custom_extension.so

0 commit comments

Comments
 (0)