From 3f7b1ba962902ddcccf6b131fc8a54351a200d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Masili=C5=ABnas?= Date: Sat, 14 Nov 2020 11:17:12 +0200 Subject: [PATCH] Adding version 7.4.12 --- .../src/Builder/GenFilesCommand.php | 18 +- .../gen-dockerfile/src/DetectPhpVersion.php | 1 + .../tests/GenFilesCommandTest.php | 47 ++-- .../tests/test_data/php74/app.yaml | 5 + .../tests/test_data/php74/composer.json | 5 + builder/php-latest.yaml | 2 +- check-versions/tests/VersionTest.php | 19 ++ cloudbuild-ubuntu.yaml | 55 ++++ integration-tests.yaml | 11 + .../patches/php74-parse_str_harden.patch | 0 package-builder/gpgkeys/php74/derick.key | 92 +++++++ package-builder/gpgkeys/php74/petk.key | 52 ++++ php-base/Dockerfile | 3 +- php-base/build-scripts/composer.sh | 16 +- php-base/build-scripts/dump_php_versions.sh | 2 +- php-base/build-scripts/install_php.sh | 3 + php-base/build-scripts/install_php74.sh | 59 +++++ .../build-scripts/src/DetectPhpVersion.php | 1 + php-versioned/php74.yaml | 11 + scripts/record_deployment_latency.sh | 2 +- scripts/release.sh | 4 + scripts/ubuntu-packages.cfg | 2 +- .../test.yaml.in | 2 +- testapps/integration/test.yaml.in | 2 +- testapps/php74_custom/.gitignore | 2 + testapps/php74_custom/Dockerfile.in | 18 ++ testapps/php74_custom/composer.json | 22 ++ testapps/php74_custom/php74.yaml | 5 + testapps/php74_custom/tests/composer.json | 6 + testapps/php74_custom/tests/phpunit.xml.dist | 8 + .../tests/tests/PHP74CustomTest.php | 139 ++++++++++ .../php74_custom/tests/tests/bootstrap.php | 17 ++ testapps/php74_custom/web/Blank300.png | Bin 0 -> 178 bytes testapps/php74_custom/web/apc.php | 42 +++ testapps/php74_custom/web/app.php | 20 ++ testapps/php74_custom/web/extensions.php | 20 ++ testapps/php74_custom/web/imagick.php | 21 ++ testapps/php74_custom/web/parse_str.php | 23 ++ testapps/php74_e2e/.gitignore | 2 + testapps/php74_e2e/Dockerfile.in | 17 ++ testapps/php74_e2e/app.yaml | 15 ++ testapps/php74_e2e/composer.json | 13 + testapps/php74_e2e/tests/composer.json | 7 + testapps/php74_e2e/tests/phpunit.xml.dist | 8 + .../php74_e2e/tests/tests/EndToEndTest.php | 250 ++++++++++++++++++ testapps/php74_e2e/tests/tests/bootstrap.php | 18 ++ testapps/php74_e2e/web/exec.php | 24 ++ testapps/php74_e2e/web/grpc_pubsub.php | 11 + testapps/php74_e2e/web/https-env.php | 19 ++ testapps/php74_e2e/web/index.php | 30 +++ testapps/php74_e2e/web/pdo_sqlite.php | 19 ++ testapps/php74_e2e/web/phpinfo.php | 18 ++ testapps/php74_e2e/web/session.php | 25 ++ .../php74_e2e/web/session_save_handler.php | 19 ++ testapps/php74_extensions/.gitignore | 1 + testapps/php74_extensions/Dockerfile.in | 15 ++ testapps/php74_extensions/composer.json | 54 ++++ testapps/php74_extensions/phpunit.xml.dist | 8 + testapps/php74_extensions/tests/Blank300.png | Bin 0 -> 178 bytes testapps/php74_extensions/tests/EvTest.php | 43 +++ testapps/php74_extensions/tests/EventTest.php | 27 ++ .../tests/ExtensionsLoadedTest.php | 57 ++++ testapps/php74_extensions/tests/GdTest.php | 33 +++ testapps/php74_extensions/tests/GmpTest.php | 34 +++ .../php74_extensions/tests/ImagickTest.php | 35 +++ testapps/php74_extensions/tests/OauthTest.php | 27 ++ .../php74_extensions/tests/PhalconTest.php | 28 ++ .../php74_extensions/tests/ProtobufTest.php | 27 ++ .../php74_extensions/tests/RdkafkaTest.php | 27 ++ testapps/php74_extensions/tests/bootstrap.php | 17 ++ testapps/php74_extensions_legacy/.gitignore | 1 + .../php74_extensions_legacy/Dockerfile.in | 15 ++ .../php74_extensions_legacy/composer.json | 41 +++ testapps/php74_extensions_legacy/php.ini | 13 + .../php74_extensions_legacy/phpunit.xml.dist | 8 + .../tests/Blank300.png | Bin 0 -> 178 bytes .../php74_extensions_legacy/tests/EvTest.php | 43 +++ .../tests/EventTest.php | 27 ++ .../tests/ExtensionsLoadedTest.php | 57 ++++ .../php74_extensions_legacy/tests/GdTest.php | 33 +++ .../php74_extensions_legacy/tests/GmpTest.php | 34 +++ .../tests/ImagickTest.php | 35 +++ .../tests/LibSodiumTest.php | 32 +++ .../tests/OauthTest.php | 27 ++ .../tests/PhalconTest.php | 28 ++ .../tests/ProtobufTest.php | 27 ++ .../tests/RdkafkaTest.php | 27 ++ .../tests/bootstrap.php | 17 ++ testapps/php_default/php_default.yaml | 2 +- 89 files changed, 2117 insertions(+), 35 deletions(-) create mode 100644 builder/gen-dockerfile/tests/test_data/php74/app.yaml create mode 100644 builder/gen-dockerfile/tests/test_data/php74/composer.json create mode 100644 package-builder/debian/patches/php74-parse_str_harden.patch create mode 100644 package-builder/gpgkeys/php74/derick.key create mode 100644 package-builder/gpgkeys/php74/petk.key create mode 100755 php-base/build-scripts/install_php74.sh create mode 100644 php-versioned/php74.yaml create mode 100644 testapps/php74_custom/.gitignore create mode 100644 testapps/php74_custom/Dockerfile.in create mode 100644 testapps/php74_custom/composer.json create mode 100644 testapps/php74_custom/php74.yaml create mode 100644 testapps/php74_custom/tests/composer.json create mode 100644 testapps/php74_custom/tests/phpunit.xml.dist create mode 100644 testapps/php74_custom/tests/tests/PHP74CustomTest.php create mode 100644 testapps/php74_custom/tests/tests/bootstrap.php create mode 100644 testapps/php74_custom/web/Blank300.png create mode 100644 testapps/php74_custom/web/apc.php create mode 100644 testapps/php74_custom/web/app.php create mode 100644 testapps/php74_custom/web/extensions.php create mode 100644 testapps/php74_custom/web/imagick.php create mode 100644 testapps/php74_custom/web/parse_str.php create mode 100644 testapps/php74_e2e/.gitignore create mode 100644 testapps/php74_e2e/Dockerfile.in create mode 100644 testapps/php74_e2e/app.yaml create mode 100644 testapps/php74_e2e/composer.json create mode 100644 testapps/php74_e2e/tests/composer.json create mode 100644 testapps/php74_e2e/tests/phpunit.xml.dist create mode 100644 testapps/php74_e2e/tests/tests/EndToEndTest.php create mode 100644 testapps/php74_e2e/tests/tests/bootstrap.php create mode 100644 testapps/php74_e2e/web/exec.php create mode 100644 testapps/php74_e2e/web/grpc_pubsub.php create mode 100644 testapps/php74_e2e/web/https-env.php create mode 100644 testapps/php74_e2e/web/index.php create mode 100644 testapps/php74_e2e/web/pdo_sqlite.php create mode 100644 testapps/php74_e2e/web/phpinfo.php create mode 100644 testapps/php74_e2e/web/session.php create mode 100644 testapps/php74_e2e/web/session_save_handler.php create mode 100644 testapps/php74_extensions/.gitignore create mode 100644 testapps/php74_extensions/Dockerfile.in create mode 100644 testapps/php74_extensions/composer.json create mode 100644 testapps/php74_extensions/phpunit.xml.dist create mode 100644 testapps/php74_extensions/tests/Blank300.png create mode 100644 testapps/php74_extensions/tests/EvTest.php create mode 100644 testapps/php74_extensions/tests/EventTest.php create mode 100644 testapps/php74_extensions/tests/ExtensionsLoadedTest.php create mode 100644 testapps/php74_extensions/tests/GdTest.php create mode 100644 testapps/php74_extensions/tests/GmpTest.php create mode 100644 testapps/php74_extensions/tests/ImagickTest.php create mode 100644 testapps/php74_extensions/tests/OauthTest.php create mode 100644 testapps/php74_extensions/tests/PhalconTest.php create mode 100644 testapps/php74_extensions/tests/ProtobufTest.php create mode 100644 testapps/php74_extensions/tests/RdkafkaTest.php create mode 100644 testapps/php74_extensions/tests/bootstrap.php create mode 100644 testapps/php74_extensions_legacy/.gitignore create mode 100644 testapps/php74_extensions_legacy/Dockerfile.in create mode 100644 testapps/php74_extensions_legacy/composer.json create mode 100644 testapps/php74_extensions_legacy/php.ini create mode 100644 testapps/php74_extensions_legacy/phpunit.xml.dist create mode 100644 testapps/php74_extensions_legacy/tests/Blank300.png create mode 100644 testapps/php74_extensions_legacy/tests/EvTest.php create mode 100644 testapps/php74_extensions_legacy/tests/EventTest.php create mode 100644 testapps/php74_extensions_legacy/tests/ExtensionsLoadedTest.php create mode 100644 testapps/php74_extensions_legacy/tests/GdTest.php create mode 100644 testapps/php74_extensions_legacy/tests/GmpTest.php create mode 100644 testapps/php74_extensions_legacy/tests/ImagickTest.php create mode 100644 testapps/php74_extensions_legacy/tests/LibSodiumTest.php create mode 100644 testapps/php74_extensions_legacy/tests/OauthTest.php create mode 100644 testapps/php74_extensions_legacy/tests/PhalconTest.php create mode 100644 testapps/php74_extensions_legacy/tests/ProtobufTest.php create mode 100644 testapps/php74_extensions_legacy/tests/RdkafkaTest.php create mode 100644 testapps/php74_extensions_legacy/tests/bootstrap.php diff --git a/builder/gen-dockerfile/src/Builder/GenFilesCommand.php b/builder/gen-dockerfile/src/Builder/GenFilesCommand.php index d3409186..cc9fddf1 100644 --- a/builder/gen-dockerfile/src/Builder/GenFilesCommand.php +++ b/builder/gen-dockerfile/src/Builder/GenFilesCommand.php @@ -57,6 +57,12 @@ protected function configure() $this ->setName('create') ->setDescription('Create Dockerfile and .dockerignore file') + ->addOption( + 'php74-image', + null, + InputOption::VALUE_REQUIRED, + 'The PHP 74 base image of the Dockerfile' + ) ->addOption( 'php73-image', null, @@ -111,17 +117,17 @@ protected function initialize(InputInterface $input, OutputInterface $output) $output->writeln(" There is no PHP runtime version specified in composer.json, or we don't support the version you specified. Google App Engine -uses the latest 7.3.x version. +uses the latest 7.4.x version. We recommend pinning your PHP version by running: -composer require php 7.3.* (replace it with your desired minor version) +composer require php 7.4.* (replace it with your desired minor version) -Using PHP version 7.3.x... +Using PHP version 7.4.x... "); } elseif ($version === DetectPhpVersion::EXACT_VERSION_SPECIFIED) { throw new ExactVersionException( "An exact PHP version was specified in composer.json. Please pin your" . - "PHP version to a minor version such as '7.3.*'." + "PHP version to a minor version such as '7.4.*'." ); } if (substr($version, 0, 3) === '5.6') { @@ -132,8 +138,10 @@ protected function initialize(InputInterface $input, OutputInterface $output) $this->detectedPhpVersion = '7.1'; } elseif (substr($version, 0, 3) === '7.2') { $this->detectedPhpVersion = '7.2'; - } else { + } elseif (substr($version, 0, 3) === '7.3') { $this->detectedPhpVersion = '7.3'; + } else { + $this->detectedPhpVersion = '7.4'; } $yamlPath = getenv('GAE_APPLICATION_YAML_PATH') ?: self::DEFAULT_YAML_PATH; diff --git a/builder/gen-dockerfile/src/DetectPhpVersion.php b/builder/gen-dockerfile/src/DetectPhpVersion.php index bf4abae1..dc782906 100644 --- a/builder/gen-dockerfile/src/DetectPhpVersion.php +++ b/builder/gen-dockerfile/src/DetectPhpVersion.php @@ -98,6 +98,7 @@ public static function isExactVersion($constraint) private static function detectAvailableVersions() { return [ + trim(file_get_contents('/opt/php74_version')), trim(file_get_contents('/opt/php73_version')), trim(file_get_contents('/opt/php72_version')), trim(file_get_contents('/opt/php71_version')), diff --git a/builder/gen-dockerfile/tests/GenFilesCommandTest.php b/builder/gen-dockerfile/tests/GenFilesCommandTest.php index b3df20a7..576379fb 100644 --- a/builder/gen-dockerfile/tests/GenFilesCommandTest.php +++ b/builder/gen-dockerfile/tests/GenFilesCommandTest.php @@ -79,6 +79,7 @@ public function testGenFilesCommand( '--php71-image' => 'gcr.io/google-appengine/php71:latest', '--php72-image' => 'gcr.io/google-appengine/php72:latest', '--php73-image' => 'gcr.io/google-appengine/php73:latest', + '--php74-image' => 'gcr.io/google-appengine/php74:latest', ]; } if ($expectedException !== null) { @@ -131,10 +132,10 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', ["COMPOSER_FLAGS='--no-dev --prefer-dist' \\\n", "FRONT_CONTROLLER_FILE='index.php' \\\n", - "DETECTED_PHP_VERSION='7.3' \n" + "DETECTED_PHP_VERSION='7.4' \n" ] ], [ @@ -144,11 +145,11 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', ["COMPOSER_FLAGS='--no-dev --prefer-dist' \\\n", "FRONT_CONTROLLER_FILE='index.php' \\\n", "SKIP_LOCKDOWN_DOCUMENT_ROOT='true' \\\n", - "DETECTED_PHP_VERSION='7.3' \n" + "DETECTED_PHP_VERSION='7.4' \n" ] ], [ @@ -169,10 +170,10 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', ["COMPOSER_FLAGS='--prefer-dist --no-dev --no-script' \\\n", "FRONT_CONTROLLER_FILE='index.php' \\\n", - "DETECTED_PHP_VERSION='7.3' \n" + "DETECTED_PHP_VERSION='7.4' \n" ] ], [ @@ -212,6 +213,19 @@ public function dataProvider() "DETECTED_PHP_VERSION='7.3' \n" ] ], + [ + // PHP 7.4 + __DIR__ . '/test_data/php74', + null, + '', + '/app', + 'added by the php runtime builder', + 'gcr.io/google-appengine/php74:latest', + ["COMPOSER_FLAGS='--no-dev --prefer-dist' \\\n", + "FRONT_CONTROLLER_FILE='index.php' \\\n", + "DETECTED_PHP_VERSION='7.4' \n" + ] + ], [ // values on env_variables __DIR__ . '/test_data/values_only_on_env', @@ -219,7 +233,7 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', [ "WHITELIST_FUNCTIONS='exec' \\\n", "FRONT_CONTROLLER_FILE='app.php'", @@ -239,7 +253,7 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', [], '\\Google\\Cloud\\Runtimes\\Builder\\Exception\\MissingDocumentRootException' ], @@ -250,7 +264,7 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', [ "WHITELIST_FUNCTIONS='exec' \\\n", "FRONT_CONTROLLER_FILE='app.php'", @@ -271,7 +285,7 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', ["FRONT_CONTROLLER_FILE='app.php' \\\n"] ], [ @@ -281,7 +295,7 @@ public function dataProvider() 'my.yaml', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest' + 'gcr.io/google-appengine/php74:latest' ], [ // Overrides baseImage @@ -292,11 +306,12 @@ public function dataProvider() '--php71-image' => 'gcr.io/php-mvm-a-28051/php71:latest', '--php72-image' => 'gcr.io/php-mvm-a-28051/php72:latest', '--php73-image' => 'gcr.io/php-mvm-a-28051/php73:latest', + '--php74-image' => 'gcr.io/php-mvm-a-28051/php74:latest', ], '', '/app', 'added by the php runtime builder', - 'gcr.io/php-mvm-a-28051/php73:latest' + 'gcr.io/php-mvm-a-28051/php74:latest' ], [ // Has document_root set @@ -305,7 +320,7 @@ public function dataProvider() '', '/app/web', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest' + 'gcr.io/google-appengine/php74:latest' ], [ // Has document_root set in env_variables @@ -314,7 +329,7 @@ public function dataProvider() '', '/app/web', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest' + 'gcr.io/google-appengine/php74:latest' ], [ // document_root in both will throw exception @@ -323,7 +338,7 @@ public function dataProvider() '', '/app/web', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', [], '\\Google\\Cloud\\Runtimes\\Builder\\Exception\\EnvConflictException' ], @@ -343,7 +358,7 @@ public function dataProvider() '', '/app', 'added by the php runtime builder', - 'gcr.io/google-appengine/php73:latest', + 'gcr.io/google-appengine/php74:latest', [], '\\Google\\Cloud\\Runtimes\\Builder\\Exception\\ExactVersionException' ] diff --git a/builder/gen-dockerfile/tests/test_data/php74/app.yaml b/builder/gen-dockerfile/tests/test_data/php74/app.yaml new file mode 100644 index 00000000..2359f78c --- /dev/null +++ b/builder/gen-dockerfile/tests/test_data/php74/app.yaml @@ -0,0 +1,5 @@ +env: flex +runtime: php + +runtime_config: + document_root: /app diff --git a/builder/gen-dockerfile/tests/test_data/php74/composer.json b/builder/gen-dockerfile/tests/test_data/php74/composer.json new file mode 100644 index 00000000..3a5b11f1 --- /dev/null +++ b/builder/gen-dockerfile/tests/test_data/php74/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "php": "7.4.*" + } +} diff --git a/builder/php-latest.yaml b/builder/php-latest.yaml index 4f946b36..e015ece7 100644 --- a/builder/php-latest.yaml +++ b/builder/php-latest.yaml @@ -1,6 +1,6 @@ steps: - name: 'gcr.io/gcp-runtimes/php/gen-dockerfile:latest' - args: ['--php73-image', 'gcr.io/google-appengine/php73:latest', '--php72-image', 'gcr.io/google-appengine/php72:latest', '--php71-image', 'gcr.io/google-appengine/php71:latest', '--php70-image', 'gcr.io/google-appengine/php70:latest', '--php56-image', 'gcr.io/google-appengine/php56:latest'] + args: ['--php74-image', 'gcr.io/google-appengine/php74:latest', '--php73-image', 'gcr.io/google-appengine/php73:latest', '--php72-image', 'gcr.io/google-appengine/php72:latest', '--php71-image', 'gcr.io/google-appengine/php71:latest', '--php70-image', 'gcr.io/google-appengine/php70:latest', '--php56-image', 'gcr.io/google-appengine/php56:latest'] env: 'GAE_APPLICATION_YAML_PATH=$_GAE_APPLICATION_YAML_PATH' - name: 'gcr.io/kaniko-project/executor:v0.6.0' args: ['--destination=$_OUTPUT_IMAGE'] diff --git a/check-versions/tests/VersionTest.php b/check-versions/tests/VersionTest.php index 2021c30a..7d6bd116 100644 --- a/check-versions/tests/VersionTest.php +++ b/check-versions/tests/VersionTest.php @@ -45,6 +45,14 @@ public static function setUpBeforeClass() 'Failed to detect the latest PHP73 version'; } + $pattern = '/PHP (7\.4\.\d+)/'; + if (preg_match($pattern, $body, $matches)) { + self::$versions['php74'] = $matches[1]; + } else { + self::$versions['php74'] = + 'Failed to detect the latest PHP74 version'; + } + exec('apt-get update'); } @@ -69,4 +77,15 @@ public function testPHP73Version() $this->fail('Failed to detect the current php73 version'); } } + + public function testPHP74Version() + { + $output = exec('apt-cache madison gcp-php74'); + $pattern = '/(7\.4\.\d+)/'; + if (preg_match($pattern, $output, $matches)) { + $this->assertEquals($matches[1], self::$versions['php74']); + } else { + $this->fail('Failed to detect the current php74 version'); + } + } } diff --git a/cloudbuild-ubuntu.yaml b/cloudbuild-ubuntu.yaml index e3bb3003..a3746ebb 100644 --- a/cloudbuild-ubuntu.yaml +++ b/cloudbuild-ubuntu.yaml @@ -22,6 +22,17 @@ steps: waitFor: ['php-base'] id: php-base-structure + # php74 + - name: gcr.io/cloud-builders/docker + args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74:$_TAG', '--build-arg', 'PHP_VERSION=7.4', '.'] + dir: php-versioned + waitFor: ['php-base'] + id: php74 + - name: gcr.io/gcp-runtimes/structure_test + args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74:$_TAG', '--config', '/workspace/php-versioned/php74.yaml', '-v'] + waitFor: ['php74'] + id: php74-structure + # php73 - name: gcr.io/cloud-builders/docker args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php73:$_TAG', '--build-arg', 'PHP_VERSION=7.3', '.'] @@ -126,6 +137,24 @@ steps: waitFor: ['php71-custom-app', 'test-runner'] id: php71-custom-test + # php74-custom test + - name: gcr.io/cloud-builders/docker + args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-custom:$_TAG', '.'] + dir: testapps/php74_custom + waitFor: ['php-onbuild'] + id: php74-custom-build + - name: gcr.io/gcp-runtimes/structure_test + args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-custom:$_TAG', '--config', 'php74.yaml', '-v'] + waitFor: ['php74-custom-build'] + - name: gcr.io/cloud-builders/docker + args: ['run', '--net=nw_$_TAG', '--name=php74-custom', '-d', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-custom:$_TAG'] + waitFor: ['php74-custom-build', 'test-network'] + id: php74-custom-app + - name: gcr.io/cloud-builders/docker + args: ['run', '--net=nw_$_TAG','-v', '/workspace:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG', '/workspace/testapps/php74_custom/tests'] + waitFor: ['php74-custom-app', 'test-runner'] + id: php74-custom-test + # php73-custom test - name: gcr.io/cloud-builders/docker args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php73-custom:$_TAG', '.'] @@ -222,9 +251,35 @@ steps: waitFor: ['php73-extensions-build'] id: php73-extensions-legacy-test + # php74-extensions test + - name: gcr.io/cloud-builders/docker + args: [ 'build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-extensions:$_TAG', '.' ] + dir: testapps/php74_extensions + waitFor: [ 'php-onbuild' ] + id: php74-extensions-build + - name: gcr.io/cloud-builders/docker + args: [ 'run', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-extensions:$_TAG', 'vendor/bin/phpunit' ] + dir: testapps/php74_extensions + waitFor: [ 'php74-extensions-build' ] + id: php74-extensions-test + + # php74-extensions-legacy test + - name: gcr.io/cloud-builders/docker + args: [ 'build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-extensions:$_TAG', '.' ] + dir: testapps/php74_extensions_legacy + waitFor: [ 'php-onbuild' ] + id: php74-extensions-legacy-build + - name: gcr.io/cloud-builders/docker + args: [ 'run', 'gcr.io/${_GOOGLE_PROJECT_ID}/php74-extensions:$_TAG', 'vendor/bin/phpunit' ] + dir: testapps/php74_extensions_legacy + waitFor: [ 'php74-extensions-build' ] + id: php74-extensions-legacy-test + + images: - gcr.io/${_GOOGLE_PROJECT_ID}/php-base:$_TAG - gcr.io/${_GOOGLE_PROJECT_ID}/php:$_TAG + - gcr.io/${_GOOGLE_PROJECT_ID}/php74:$_TAG - gcr.io/${_GOOGLE_PROJECT_ID}/php73:$_TAG - gcr.io/${_GOOGLE_PROJECT_ID}/php72:$_TAG - gcr.io/${_GOOGLE_PROJECT_ID}/php71:$_TAG diff --git a/integration-tests.yaml b/integration-tests.yaml index 974f422c..f5db3c08 100644 --- a/integration-tests.yaml +++ b/integration-tests.yaml @@ -6,6 +6,17 @@ steps: waitFor: ['-'] id: test-runner + # php74_e2e test + - name: gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG + args: ['/workspace/testapps/php74_e2e/tests'] + waitFor: ['test-runner'] + id: php74_e2e + env: + - 'SERVICE_ACCOUNT_JSON=${_SERVICE_ACCOUNT_JSON}' + - 'TAG=${_TAG}-e2e' + - 'E2E_PROJECT_ID=${_E2E_PROJECT_ID}' + - 'TEST_VM_IMAGE=${_TEST_VM_IMAGE}' + # php73_e2e test - name: gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG args: ['/workspace/testapps/php73_e2e/tests'] diff --git a/package-builder/debian/patches/php74-parse_str_harden.patch b/package-builder/debian/patches/php74-parse_str_harden.patch new file mode 100644 index 00000000..e69de29b diff --git a/package-builder/gpgkeys/php74/derick.key b/package-builder/gpgkeys/php74/derick.key new file mode 100644 index 00000000..574fdf58 --- /dev/null +++ b/package-builder/gpgkeys/php74/derick.key @@ -0,0 +1,92 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFz/qPEBEADrf32izstZbS3xXCESaNKP7UvXhHKHzVA8QzXk/UOtRdqDF4u7 +sUaZ5ybuvf/QIDebqzOGki/2pnyJ+TUpk9iQpBR4XEm9+u1F9x8N7DVienhqeyXj +6MBG/ToZ07CQbsSLJWS1I/J/SEaotrJ5CGaoOXZzE8m487wk5IMhKCTfetT3j9AF +YDZFEtIm0Hcxm6lj1npG9gyzDJFtxgpZCWpnT2JnggOp546mX9i4hYQKX/31ukQS +ioUP202Wlpj6YPLaKFPpFZ77i559tJZ8USPGkZ37HVxwIoqpWJiCASXRvD5LrRFp +L7nEQ4b3Ce5GtVGdV70RtNjDb7Ex0OwFoWXSq8s9j/roF94P6JmkD903YGuw4sta +TsIn3IKCgfEvXzkYwttA3LrztsJ5VQYMgEXno4rMYEDtsmJbpn5dWRVfXqWL3TxM +GcvLoMi1gipgWZKAYIBi+ICayrW/91U512l0DMNbhF8fkWsE2ilgz3YWzAXw20M3 +5Wy3BYBRADYgNfd9jA+KYhX7Ebx5uBUAvLudaQB2wUY+hmRQlr7HkufxZQ4XfuQx +s22F3+4F6XJ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SgblLdTz/rfX5ABEBAAGJAjwEGAEKACYWIQRaUogHgfdVYIv4FfyR +DetG9T6jEgUCXP+o8QIbDAUJEswDAAAKCRCRDetG9T6jEhaaD/wIcZXviioqs1/S +u5RodZ+bUuT778ICnq5Jl4w6QlJP/g2Xl/Y7do8DtdWTh1q+8cDcitLTncszvFRR +vQWdqsoyUqD//d/om29q96B7rN8beqP+zp9L/wSChmRLezLAYdjPLb32yBkrHt4X ++mRWP+iWAND8ymQzmxykOFjWseO+FxHywszw7kOQ5/JNoSJG6mExEX0bbWm7eQg9 +/gL/i0w3ROY0HN370vqfiJCihWzHMCiGOUhCXoOOcYzlTsije59CoK4Y6Ek10w9u +5of9m0vGGeu7WRmIdOg+gZEMBbxh2MGdgiWNbvdEo+AymQiIvnoNdKxvzuooEtnd +oGSNk7Y3FPcZQ9sIBhD9vklDQ567bBt9gNnyWv6sBMQP/1nqauY8+CZWD4SZelfd +vIGV8u9a6SdlCAQXJkSJBQ1aw9fUwv5VdRL1WQdieBno8NI9EQ/6s39fCw1oIqDv +oPHdVzGr7Q2P1zqoQ+iILh5AZruJJzvKUexiVD2ouvBIFeY6gZKcWSlOjISLfdID +YWpmosi8bX7PuyqJOJZtN2NnwZKEDBkMOexs1TG571iJgU1TASQmFzGQClrAaE21 +aRsO1Ou9FEAdnnwIwMxG+lop8ZykX5GXJG6ZOUQKGmL681fdTKivatoPXZiiUhQZ +uNV2Pe9hGTB2+hDdxkmllksfJP2cNQ== +=0twV +-----END PGP PUBLIC KEY BLOCK----- diff --git a/package-builder/gpgkeys/php74/petk.key b/package-builder/gpgkeys/php74/petk.key new file mode 100644 index 00000000..f5a4b89d --- /dev/null +++ b/package-builder/gpgkeys/php74/petk.key @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFzu5noBEACvjtOopc8qTQVT7N6DCGRLF6tupjmPPb2yaM+Fkl42RpI1vR1J +X9t9f6xNOTupjmG+0ZRTEz91kyVvrcFvO91TO1fw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wxQopg5chi5vLQz07+aTXenfaaIrYeWnExvwjK+gBuYiwAR +AQABiQI8BBgBCAAmFiEEQmcKf+TQRByORjI0nk/cB0pO8C0FAlzu5noCGwwFCQPC +ZwAACgkQnk/cB0pO8C0paw/+NBJsS1lbLm0n1qUSLcigrgZSPN1ho6mW9ZdjUfoF +I9TmMwTdMcoQDf1F6WGQ3cTWYEzY8sjZMQ5P6uHtHCTBCje0feWeL8eW6qw7geaB ++W1qGMZGTMrDHANsf5LguBNaJV+4BhB4Ds+sW8/thhmcaI3wE4+jdvr5DQcvcJys +a1znI6+/dKHMnYdUmIxHDEd9RYZtsnpwh3+f3GNOFkEVZLCXLvOq97wBoJgDAhwj +6MUehzzRNfB495f89HyUf3VLFkko/FMIJSY0By8k2FUphPKBV6E5gNOOHxzdxD/Q +WZwgJzfv0cRIhZhhOLYjuGdNy9jTNTxFSqndoRpsxUUCXj0KoR+J49S71ozNlNlr +47AxwwVLIUg8o8wyX2P0b9BY+Q1vtqyWiT999YlDLX823ltMSL1OGzzSEsC702/j +C8/ny6IHrVmnzJq7o1kL5rYWCF+iPLFRtG9HZRjfx0nKiFiZm+yT8z8zlRncRVJq +Izgp9DOQqQxewl4epKmioE5oWENbaaj5eN7kJ0G+n4EU5mF0HS5J0axk46/i1Bf0 +++Y5bsvekZv4Yn8tFwHa02vQx5fIdUHdmuLtYB5BlNgfZReZzk7rTaqNLf5ivzp5 +qJpJuYY0yTiQEvZZQMLITKOGj5C91t61HK29RbUT1AfbrZBZfnRqRirVSPAcupRO +8nw= +=DBgL +-----END PGP PUBLIC KEY BLOCK----- diff --git a/php-base/Dockerfile b/php-base/Dockerfile index 14f4313a..b13f205c 100644 --- a/php-base/Dockerfile +++ b/php-base/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Dockerfile for PHP 7.1/7.2/7.3 using nginx as the webserver. +# Dockerfile for PHP 7.1/7.2/7.3/7.4 using nginx as the webserver. FROM gcr.io/gcp-runtimes/ubuntu_16_0_4 @@ -68,6 +68,7 @@ ENV NGINX_DIR=/etc/nginx \ PHP71_DIR=/opt/php71 \ PHP72_DIR=/opt/php72 \ PHP73_DIR=/opt/php73 \ + PHP74_DIR=/opt/php74 \ APP_DIR=/app \ NGINX_USER_CONF_DIR=/etc/nginx/conf.d \ UPLOAD_DIR=/upload \ diff --git a/php-base/build-scripts/composer.sh b/php-base/build-scripts/composer.sh index edced9f3..7775e14b 100644 --- a/php-base/build-scripts/composer.sh +++ b/php-base/build-scripts/composer.sh @@ -23,7 +23,7 @@ else set -e fi -DEFAULT_PHP_VERSION="7.3" +DEFAULT_PHP_VERSION="7.4" if [ -f ${APP_DIR}/composer.json ]; then if [ -n "${DETECTED_PHP_VERSION}" ]; then @@ -36,16 +36,16 @@ if [ -f ${APP_DIR}/composer.json ]; then if [ "${PHP_VERSION}" == "exact" ]; then cat< cloudbuild-test-runner/Dockerfile diff --git a/scripts/release.sh b/scripts/release.sh index c488d9e0..2d7e68b6 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -19,6 +19,7 @@ scripts/build_images.sh IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php:${TAG}" BASE_IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php-base:${TAG}" +PHP74_IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php74:${TAG}" PHP73_IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php73:${TAG}" PHP72_IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php72:${TAG}" PHP71_IMAGE_NAME="gcr.io/${GOOGLE_PROJECT_ID}/php71:${TAG}" @@ -28,6 +29,7 @@ if [ "${ADD_CANDIDATE_TAG}" = "true" ]; then echo "CANDIDATE_TAG:${CANDIDATE_TAG}" gcloud -q beta container images add-tag "${IMAGE_NAME}" "${DOCKER_NAMESPACE}/php:${CANDIDATE_TAG}" gcloud -q beta container images add-tag "${BASE_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php-base:${CANDIDATE_TAG}" + gcloud -q beta container images add-tag "${PHP74_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php74:${CANDIDATE_TAG}" gcloud -q beta container images add-tag "${PHP73_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php73:${CANDIDATE_TAG}" gcloud -q beta container images add-tag "${PHP72_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php72:${CANDIDATE_TAG}" gcloud -q beta container images add-tag "${PHP71_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php71:${CANDIDATE_TAG}" @@ -37,6 +39,7 @@ fi if [ "${ADD_STAGING_TAG}" = "true" ]; then gcloud -q beta container images add-tag "${IMAGE_NAME}" "${DOCKER_NAMESPACE}/php:staging" gcloud -q beta container images add-tag "${BASE_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php-base:staging" + gcloud -q beta container images add-tag "${PHP74_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php74:staging" gcloud -q beta container images add-tag "${PHP73_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php73:staging" gcloud -q beta container images add-tag "${PHP72_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php72:staging" gcloud -q beta container images add-tag "${PHP71_IMAGE_NAME}" "${DOCKER_NAMESPACE}/php71:staging" @@ -47,6 +50,7 @@ METADATA=$(pwd)/METADATA cd ${KOKORO_GFILE_DIR}/kokoro python note.py php -m ${METADATA} -t ${TAG} python note.py php-base -m ${METADATA} -t ${TAG} +python note.py php74 -m ${METADATA} -t ${TAG} python note.py php73 -m ${METADATA} -t ${TAG} python note.py php72 -m ${METADATA} -t ${TAG} python note.py php71 -m ${METADATA} -t ${TAG} diff --git a/scripts/ubuntu-packages.cfg b/scripts/ubuntu-packages.cfg index d910bab7..5fae0316 100644 --- a/scripts/ubuntu-packages.cfg +++ b/scripts/ubuntu-packages.cfg @@ -5,6 +5,6 @@ env_vars { env_vars { key: "PHP_VERSIONS" - value: "7.3.23-1,7.2.34-1,7.1.33-1" + value: "7.4.12-1,7.3.23-1,7.2.34-1,7.1.33-1" } diff --git a/testapps/integration-individual-packages/test.yaml.in b/testapps/integration-individual-packages/test.yaml.in index 3836d968..5c63be92 100644 --- a/testapps/integration-individual-packages/test.yaml.in +++ b/testapps/integration-individual-packages/test.yaml.in @@ -1,6 +1,6 @@ steps: - name: '${STAGING_BUILDER_IMAGE}' - args: ['--php73-image', 'gcr.io/google-appengine/php73:staging', '--php72-image', 'gcr.io/google-appengine/php72:staging', '--php71-image', 'gcr.io/google-appengine/php71:staging'] + args: ['--php74-image', 'gcr.io/google-appengine/php74:staging', '--php73-image', 'gcr.io/google-appengine/php73:staging', '--php72-image', 'gcr.io/google-appengine/php72:staging', '--php71-image', 'gcr.io/google-appengine/php71:staging'] - name: 'gcr.io/cloud-builders/docker:latest' args: ['build', '-t', '$_OUTPUT_IMAGE', '.'] images: diff --git a/testapps/integration/test.yaml.in b/testapps/integration/test.yaml.in index 3836d968..5c63be92 100644 --- a/testapps/integration/test.yaml.in +++ b/testapps/integration/test.yaml.in @@ -1,6 +1,6 @@ steps: - name: '${STAGING_BUILDER_IMAGE}' - args: ['--php73-image', 'gcr.io/google-appengine/php73:staging', '--php72-image', 'gcr.io/google-appengine/php72:staging', '--php71-image', 'gcr.io/google-appengine/php71:staging'] + args: ['--php74-image', 'gcr.io/google-appengine/php74:staging', '--php73-image', 'gcr.io/google-appengine/php73:staging', '--php72-image', 'gcr.io/google-appengine/php72:staging', '--php71-image', 'gcr.io/google-appengine/php71:staging'] - name: 'gcr.io/cloud-builders/docker:latest' args: ['build', '-t', '$_OUTPUT_IMAGE', '.'] images: diff --git a/testapps/php74_custom/.gitignore b/testapps/php74_custom/.gitignore new file mode 100644 index 00000000..09a29da8 --- /dev/null +++ b/testapps/php74_custom/.gitignore @@ -0,0 +1,2 @@ +cloudbuild.yaml +Dockerfile diff --git a/testapps/php74_custom/Dockerfile.in b/testapps/php74_custom/Dockerfile.in new file mode 100644 index 00000000..2b1ce1c8 --- /dev/null +++ b/testapps/php74_custom/Dockerfile.in @@ -0,0 +1,18 @@ +# Copyright 2015 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ${BASE_IMAGE} + +ENV DOCUMENT_ROOT=/app/web +ENV FRONT_CONTROLLER_FILE=app.php diff --git a/testapps/php74_custom/composer.json b/testapps/php74_custom/composer.json new file mode 100644 index 00000000..21d1038d --- /dev/null +++ b/testapps/php74_custom/composer.json @@ -0,0 +1,22 @@ +{ + "require": { + "php": "7.4.*", + "ext-bcmath": "*", + "ext-calendar": "*", + "ext-exif": "*", + "ext-ftp": "*", + "ext-gd": "*", + "ext-gettext": "*", + "ext-intl": "*", + "ext-shmop": "*", + "ext-soap": "*", + "ext-sqlite3": "*", + "ext-pdo_sqlite": "*", + "ext-xmlrpc": "*", + "ext-xsl": "*", + "ext-mongodb": "*", + "ext-redis": "*", + "ext-imagick": "*", + "silex/silex": "^1.3" + } +} diff --git a/testapps/php74_custom/php74.yaml b/testapps/php74_custom/php74.yaml new file mode 100644 index 00000000..f71ecd8a --- /dev/null +++ b/testapps/php74_custom/php74.yaml @@ -0,0 +1,5 @@ +schemaVersion: "1.0.0" +commandTests: + - name: "version" + command: ["/opt/php/bin/php", "-v"] + expectedOutput: ["PHP 7\\.4.*"] diff --git a/testapps/php74_custom/tests/composer.json b/testapps/php74_custom/tests/composer.json new file mode 100644 index 00000000..c3a35663 --- /dev/null +++ b/testapps/php74_custom/tests/composer.json @@ -0,0 +1,6 @@ +{ + "require-dev": { + "guzzlehttp/guzzle": "~6.0", + "symfony/browser-kit": "~2" + } +} diff --git a/testapps/php74_custom/tests/phpunit.xml.dist b/testapps/php74_custom/tests/phpunit.xml.dist new file mode 100644 index 00000000..8ded8984 --- /dev/null +++ b/testapps/php74_custom/tests/phpunit.xml.dist @@ -0,0 +1,8 @@ + + + + + tests + + + diff --git a/testapps/php74_custom/tests/tests/PHP74CustomTest.php b/testapps/php74_custom/tests/tests/PHP74CustomTest.php new file mode 100644 index 00000000..bc5e9431 --- /dev/null +++ b/testapps/php74_custom/tests/tests/PHP74CustomTest.php @@ -0,0 +1,139 @@ +client = new Client(['base_uri' => 'http://php74-custom:8080/']); + } + + public function testExtensions() + { + $resp = $this->client->get('extensions.php'); + $loaded = $resp->getBody()->getContents(); + foreach (self::$extensions as $ext) { + $this->assertContains($ext, $loaded); + } + } + + public function testApcIsAbleToExecuteCommonOperations() + { + $resp = $this->client->get('apc.php'); + $body = $resp->getBody()->getContents(); + + $this->assertContains('success storing in apc bc', $body); + $this->assertContains('success fetching from apc bc', $body); + $this->assertContains('success deleting from apc bc', $body); + $this->assertContains('success storing in apcu', $body); + $this->assertContains('success fetching from apcu', $body); + $this->assertContains('success deleting from apcu', $body); + } + + public function testImagickCanLoad() + { + $resp = $this->client->get('imagick.php'); + $body = $resp->getBody()->getContents(); + + // test image should by 300px by 1px + $this->assertContains('300x1', $body); + } + + public function testFrontControllerFileEnv() + { + // Access the top page and it should be served by app.php + $resp = $this->client->get(''); + $body = $resp->getBody()->getContents(); + $this->assertContains('FRONT_CONTROLLER_FILE works', $body); + } +} diff --git a/testapps/php74_custom/tests/tests/bootstrap.php b/testapps/php74_custom/tests/tests/bootstrap.php new file mode 100644 index 00000000..864f1cd1 --- /dev/null +++ b/testapps/php74_custom/tests/tests/bootstrap.php @@ -0,0 +1,17 @@ +|H(?D8gCb z5n0T@z%2~Ij105pNB{-dOFVsD*{^c5h_NtFjy?r4K(@p+qQp5rH#aq}gu%HeHL)Z$ zMWH;iBts!2BUQoO(>LIKifSHEp_r$OV@SoV $value) { + echo $value . "\n"; +} diff --git a/testapps/php74_custom/web/imagick.php b/testapps/php74_custom/web/imagick.php new file mode 100644 index 00000000..59ed28fb --- /dev/null +++ b/testapps/php74_custom/web/imagick.php @@ -0,0 +1,21 @@ +getImageGeometry(); +echo $dimensions['width'] . 'x' . $dimensions['height']; diff --git a/testapps/php74_custom/web/parse_str.php b/testapps/php74_custom/web/parse_str.php new file mode 100644 index 00000000..978b35d1 --- /dev/null +++ b/testapps/php74_custom/web/parse_str.php @@ -0,0 +1,23 @@ + + + + + tests + + + diff --git a/testapps/php74_e2e/tests/tests/EndToEndTest.php b/testapps/php74_e2e/tests/tests/EndToEndTest.php new file mode 100644 index 00000000..2260dfa2 --- /dev/null +++ b/testapps/php74_e2e/tests/tests/EndToEndTest.php @@ -0,0 +1,250 @@ +eventuallyConsistentRetryCount = 10; + $this->catchAllExceptions = true; + + $url = sprintf('https://%s-dot-%s.appspot.com/', + getenv(self::VERSION_ENV), + getenv(self::PROJECT_ENV)); + $this->client = new Client(['base_uri' => $url]); + } + + public function testIndex() + { + $this->runEventuallyConsistentTest(function () { + // Index serves succesfully with 'Hello World'. + // This works because the custom DOCUMENT_ROOT is working. + $resp = $this->client->get('index.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'index.php status code'); + $this->assertContains('Hello World', $resp->getBody()->getContents()); + }); + } + + public function testHttpsEnv() + { + $this->runEventuallyConsistentTest(function () { + // Check the HTTPS envvar on the server + $resp = $this->client->get('https-env.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'https-env.php status code'); + $this->assertContains('HTTPS: on', $resp->getBody()->getContents()); + }); + } + + public function testGoodbye() + { + $this->runEventuallyConsistentTest(function () { + // The URL '/goodbye' works with 'Goodbye World'. + // This works because the nginx-app.conf is effective. + $resp = $this->client->get('/goodbye'); + $this->assertEquals('200', $resp->getStatusCode(), + '/goodbye status code'); + $this->assertContains('Goodbye World', + $resp->getBody()->getContents()); + }); + } + + public function testPhpInfo() + { + $this->runEventuallyConsistentTest(function () { + // Access to phpinfo.php, while phpinfo() should be enabled this time. + $resp = $this->client->get('phpinfo.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'phpinfo.php status code'); + $this->assertTrue(strlen($resp->getBody()->getContents()) > 1000, + 'phpinfo() should be enabled.'); + }); + } + + public function testExec() + { + $this->runEventuallyConsistentTest(function () { + // Access to exec.php; exec() should be enabled. + $resp = $this->client->get('exec.php'); + $this->assertEquals( + '200', + $resp->getStatusCode(), + 'exec.php status code' + ); + $this->assertContains( + 'exec succeeded.', + $resp->getBody()->getContents() + ); + }); + } + + public function testPdoSqlite() + { + $this->runEventuallyConsistentTest(function () { + // Access to pdo_sqlite.php, which should work. + $resp = $this->client->get('pdo_sqlite.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'pdo_sqlite.php status code'); + $this->assertContains('Hello pdo_sqlite', + $resp->getBody()->getContents()); + }); + } + + public function testSessionSaveHandler() + { + $this->markTestSkipped('Memcache is not available on env:flex.'); + $this->runEventuallyConsistentTest(function () { + $resp = $this->client->get('session_save_handler.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'session_save_handler status code'); + $this->assertContains('memcached', + $resp->getBody()->getContents()); + }); + } + + public function testSession() + { + $this->markTestSkipped('Memcache is not available on env:flex.'); + $this->runEventuallyConsistentTest(function () { + $jar = new CookieJar(); + $resp = $this->client->get('session.php', ['cookies' => $jar]); + $this->assertEquals('200', $resp->getStatusCode(), + 'session.php status code'); + $this->assertEquals('0', $body = $resp->getBody()->getContents()); + + $resp = $this->client->get('session.php', ['cookies' => $jar]); + $this->assertEquals('200', $resp->getStatusCode(), + 'session.php status code'); + $this->assertEquals('1', $body = $resp->getBody()->getContents()); + }); + } + + public function testGrpcPubsub() + { + $this->runEventuallyConsistentTest(function () { + $resp = $this->client->get('grpc_pubsub.php'); + $this->assertEquals('200', $resp->getStatusCode(), + 'grpc_pubsub.php status code'); + }); + } +} diff --git a/testapps/php74_e2e/tests/tests/bootstrap.php b/testapps/php74_e2e/tests/tests/bootstrap.php new file mode 100644 index 00000000..823a5ebe --- /dev/null +++ b/testapps/php74_e2e/tests/tests/bootstrap.php @@ -0,0 +1,18 @@ + 'grpc']); + +foreach ($client->topics() as $topic) { + echo $topic->name() . '
'; +} diff --git a/testapps/php74_e2e/web/https-env.php b/testapps/php74_e2e/web/https-env.php new file mode 100644 index 00000000..fb430257 --- /dev/null +++ b/testapps/php74_e2e/web/https-env.php @@ -0,0 +1,19 @@ +get('/', function () { + return 'Hello World'; +}); + +$app->get('/goodbye', function () { + return 'Goodbye World'; +}); + +$app->run(); diff --git a/testapps/php74_e2e/web/pdo_sqlite.php b/testapps/php74_e2e/web/pdo_sqlite.php new file mode 100644 index 00000000..5b800090 --- /dev/null +++ b/testapps/php74_e2e/web/pdo_sqlite.php @@ -0,0 +1,19 @@ + + + + + tests + + + diff --git a/testapps/php74_extensions/tests/Blank300.png b/testapps/php74_extensions/tests/Blank300.png new file mode 100644 index 0000000000000000000000000000000000000000..e96fe466c1a8cd40d54a80844880b78f7137bf04 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!89CU1WQxUPO(4aV|H(?D8gCb z5n0T@z%2~Ij105pNB{-dOFVsD*{^c5h_NtFjy?r4K(@p+qQp5rH#aq}gu%HeHL)Z$ zMWH;iBts!2BUQoO(>LIKifSHEp_r$OV@SoVassertTrue(extension_loaded('ev')); + } + + public function testTimer() + { + // after 5ms, update success + $w1 = new EvTimer(0.005, 0, function () { + $this->success = true; + }); + Ev::run(); + + // sleep 10ms + usleep(10000); + + Ev::stop(); + + $this->assertTrue($this->success); + } +} diff --git a/testapps/php74_extensions/tests/EventTest.php b/testapps/php74_extensions/tests/EventTest.php new file mode 100644 index 00000000..1fe6535f --- /dev/null +++ b/testapps/php74_extensions/tests/EventTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('event')); + } +} diff --git a/testapps/php74_extensions/tests/ExtensionsLoadedTest.php b/testapps/php74_extensions/tests/ExtensionsLoadedTest.php new file mode 100644 index 00000000..6bf2f3f4 --- /dev/null +++ b/testapps/php74_extensions/tests/ExtensionsLoadedTest.php @@ -0,0 +1,57 @@ +assertTrue(extension_loaded($extensionName)); + } + + public function extensions() + { + return [ + ['amqp'], + ['bitset'], + ['couchbase'], + ['ds'], + ['eio'], + ['hprose'], + ['igbinary'], + ['jsond'], + ['krb5'], + ['lua'], + ['lzf'], + ['memprof'], + ['opencensus'], + ['seaslog'], + ['stackdriver_debugger'], + ['stomp'], + ['sync'], + ['tcpwrap'], + ['timezonedb'], + ['vips'], + ['yaconf'], + ['yaf'], + ['yaml'] + ]; + } +} diff --git a/testapps/php74_extensions/tests/GdTest.php b/testapps/php74_extensions/tests/GdTest.php new file mode 100644 index 00000000..c663b508 --- /dev/null +++ b/testapps/php74_extensions/tests/GdTest.php @@ -0,0 +1,33 @@ +assertTrue(extension_loaded('gd')); + } + + public function testFreetypeSupport() + { + $this->assertTrue( + gd_info()['FreeType Support'], + 'GD should support Freetype' + ); + } +} diff --git a/testapps/php74_extensions/tests/GmpTest.php b/testapps/php74_extensions/tests/GmpTest.php new file mode 100644 index 00000000..ed7e0821 --- /dev/null +++ b/testapps/php74_extensions/tests/GmpTest.php @@ -0,0 +1,34 @@ +assertTrue(extension_loaded('gmp')); + } + + public function testGcd() + { + // basic test for greatest common denominator to see if gmp works + $this->assertEquals( + 3, + gmp_intval(gmp_gcd("12", "21")) + ); + } +} diff --git a/testapps/php74_extensions/tests/ImagickTest.php b/testapps/php74_extensions/tests/ImagickTest.php new file mode 100644 index 00000000..4670b141 --- /dev/null +++ b/testapps/php74_extensions/tests/ImagickTest.php @@ -0,0 +1,35 @@ +assertTrue(extension_loaded('imagick')); + } + + public function testLoadImage() + { + $image = new Imagick(__DIR__ . '/Blank300.png'); + $dimensions = $image->getImageGeometry(); + $this->assertEquals(300, $dimensions['width']); + $this->assertEquals(1, $dimensions['height']); + } +} diff --git a/testapps/php74_extensions/tests/OauthTest.php b/testapps/php74_extensions/tests/OauthTest.php new file mode 100644 index 00000000..f0fa2572 --- /dev/null +++ b/testapps/php74_extensions/tests/OauthTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('oauth')); + } +} diff --git a/testapps/php74_extensions/tests/PhalconTest.php b/testapps/php74_extensions/tests/PhalconTest.php new file mode 100644 index 00000000..84ed26d1 --- /dev/null +++ b/testapps/php74_extensions/tests/PhalconTest.php @@ -0,0 +1,28 @@ +markTestSkipped('Phalcon is not available for PHP 7.1 yet.'); + // $this->assertTrue(extension_loaded('phalcon')); + } +} diff --git a/testapps/php74_extensions/tests/ProtobufTest.php b/testapps/php74_extensions/tests/ProtobufTest.php new file mode 100644 index 00000000..0d9606e5 --- /dev/null +++ b/testapps/php74_extensions/tests/ProtobufTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('protobuf')); + } +} diff --git a/testapps/php74_extensions/tests/RdkafkaTest.php b/testapps/php74_extensions/tests/RdkafkaTest.php new file mode 100644 index 00000000..2e522a4e --- /dev/null +++ b/testapps/php74_extensions/tests/RdkafkaTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('rdkafka')); + } +} diff --git a/testapps/php74_extensions/tests/bootstrap.php b/testapps/php74_extensions/tests/bootstrap.php new file mode 100644 index 00000000..f76545c7 --- /dev/null +++ b/testapps/php74_extensions/tests/bootstrap.php @@ -0,0 +1,17 @@ + + + + + tests + + + diff --git a/testapps/php74_extensions_legacy/tests/Blank300.png b/testapps/php74_extensions_legacy/tests/Blank300.png new file mode 100644 index 0000000000000000000000000000000000000000..e96fe466c1a8cd40d54a80844880b78f7137bf04 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!89CU1WQxUPO(4aV|H(?D8gCb z5n0T@z%2~Ij105pNB{-dOFVsD*{^c5h_NtFjy?r4K(@p+qQp5rH#aq}gu%HeHL)Z$ zMWH;iBts!2BUQoO(>LIKifSHEp_r$OV@SoVassertTrue(extension_loaded('ev')); + } + + public function testTimer() + { + // after 5ms, update success + $w1 = new EvTimer(0.005, 0, function () { + $this->success = true; + }); + Ev::run(); + + // sleep 10ms + usleep(10000); + + Ev::stop(); + + $this->assertTrue($this->success); + } +} diff --git a/testapps/php74_extensions_legacy/tests/EventTest.php b/testapps/php74_extensions_legacy/tests/EventTest.php new file mode 100644 index 00000000..1fe6535f --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/EventTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('event')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/ExtensionsLoadedTest.php b/testapps/php74_extensions_legacy/tests/ExtensionsLoadedTest.php new file mode 100644 index 00000000..6bf2f3f4 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/ExtensionsLoadedTest.php @@ -0,0 +1,57 @@ +assertTrue(extension_loaded($extensionName)); + } + + public function extensions() + { + return [ + ['amqp'], + ['bitset'], + ['couchbase'], + ['ds'], + ['eio'], + ['hprose'], + ['igbinary'], + ['jsond'], + ['krb5'], + ['lua'], + ['lzf'], + ['memprof'], + ['opencensus'], + ['seaslog'], + ['stackdriver_debugger'], + ['stomp'], + ['sync'], + ['tcpwrap'], + ['timezonedb'], + ['vips'], + ['yaconf'], + ['yaf'], + ['yaml'] + ]; + } +} diff --git a/testapps/php74_extensions_legacy/tests/GdTest.php b/testapps/php74_extensions_legacy/tests/GdTest.php new file mode 100644 index 00000000..c663b508 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/GdTest.php @@ -0,0 +1,33 @@ +assertTrue(extension_loaded('gd')); + } + + public function testFreetypeSupport() + { + $this->assertTrue( + gd_info()['FreeType Support'], + 'GD should support Freetype' + ); + } +} diff --git a/testapps/php74_extensions_legacy/tests/GmpTest.php b/testapps/php74_extensions_legacy/tests/GmpTest.php new file mode 100644 index 00000000..ed7e0821 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/GmpTest.php @@ -0,0 +1,34 @@ +assertTrue(extension_loaded('gmp')); + } + + public function testGcd() + { + // basic test for greatest common denominator to see if gmp works + $this->assertEquals( + 3, + gmp_intval(gmp_gcd("12", "21")) + ); + } +} diff --git a/testapps/php74_extensions_legacy/tests/ImagickTest.php b/testapps/php74_extensions_legacy/tests/ImagickTest.php new file mode 100644 index 00000000..4670b141 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/ImagickTest.php @@ -0,0 +1,35 @@ +assertTrue(extension_loaded('imagick')); + } + + public function testLoadImage() + { + $image = new Imagick(__DIR__ . '/Blank300.png'); + $dimensions = $image->getImageGeometry(); + $this->assertEquals(300, $dimensions['width']); + $this->assertEquals(1, $dimensions['height']); + } +} diff --git a/testapps/php74_extensions_legacy/tests/LibSodiumTest.php b/testapps/php74_extensions_legacy/tests/LibSodiumTest.php new file mode 100644 index 00000000..9f2ac230 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/LibSodiumTest.php @@ -0,0 +1,32 @@ +assertTrue(extension_loaded('sodium')); + } + + public function testLoadImage() + { + $re = new ReflectionExtension('sodium'); + $libsodiumVersion = $re->getVersion(); + $this->assertTrue(version_compare($libsodiumVersion, '2.0.0', '>=')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/OauthTest.php b/testapps/php74_extensions_legacy/tests/OauthTest.php new file mode 100644 index 00000000..f0fa2572 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/OauthTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('oauth')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/PhalconTest.php b/testapps/php74_extensions_legacy/tests/PhalconTest.php new file mode 100644 index 00000000..84ed26d1 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/PhalconTest.php @@ -0,0 +1,28 @@ +markTestSkipped('Phalcon is not available for PHP 7.1 yet.'); + // $this->assertTrue(extension_loaded('phalcon')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/ProtobufTest.php b/testapps/php74_extensions_legacy/tests/ProtobufTest.php new file mode 100644 index 00000000..0d9606e5 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/ProtobufTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('protobuf')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/RdkafkaTest.php b/testapps/php74_extensions_legacy/tests/RdkafkaTest.php new file mode 100644 index 00000000..2e522a4e --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/RdkafkaTest.php @@ -0,0 +1,27 @@ +assertTrue(extension_loaded('rdkafka')); + } +} diff --git a/testapps/php74_extensions_legacy/tests/bootstrap.php b/testapps/php74_extensions_legacy/tests/bootstrap.php new file mode 100644 index 00000000..f76545c7 --- /dev/null +++ b/testapps/php74_extensions_legacy/tests/bootstrap.php @@ -0,0 +1,17 @@ +