From d8400516e825d3d5022855d3a336c6e95b84ad9d Mon Sep 17 00:00:00 2001 From: Vidar Date: Thu, 9 Aug 2018 09:06:45 +0200 Subject: [PATCH 1/3] Added solr service template to platform.sh config (#282) --- .platform.app.yaml | 2 ++ .platform/services.yaml | 18 ++++++++++++++++++ app/config/env/platformsh.php | 11 +++++++++++ 3 files changed, 31 insertions(+) diff --git a/.platform.app.yaml b/.platform.app.yaml index d4b3c5349b..10ce545803 100644 --- a/.platform.app.yaml +++ b/.platform.app.yaml @@ -25,6 +25,8 @@ relationships: # If you wish to have a separate Redis instance for sessions, uncomment # this relationship and the corresponding service in .platform/services.yaml #redissession: 'redissession:redis' + # If you wish to use solr, uncomment this relationship and the corresponding service in .platform/services.yaml + #solr: 'solrsearch:solr' variables: #php: diff --git a/.platform/services.yaml b/.platform/services.yaml index 9ee8b931b3..616be0e1ee 100644 --- a/.platform/services.yaml +++ b/.platform/services.yaml @@ -31,3 +31,21 @@ rediscache: #redissession: # type: redis-persistent:3.2 # disk: 1024 + +# If you wish to use solr, uncomment this service and the corresponding relationship in .platform.app.yaml. +# Also, you need to generate the config using: +# vendor/ezsystems/ezplatform-solr-search-engine/bin/generate-solr-config.sh +#solrsearch: +# type: solr:6.6 +# disk: 512 +# configuration: +# configsets: +# mainconfig: !archive "configsets/solr6" +# cores: +# collection1: +# core_properties: | +# configSet=mainconfig +# schema=schema.xml +# endpoints: +# collection1: +# core: collection1 diff --git a/app/config/env/platformsh.php b/app/config/env/platformsh.php index 17da9fc5a0..86b831f06d 100644 --- a/app/config/env/platformsh.php +++ b/app/config/env/platformsh.php @@ -119,3 +119,14 @@ $container->setParameter('session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); } } + +if (isset($relationships['solr'])) { + foreach ($relationships['solr'] as $endpoint) { + if ($endpoint['scheme'] !== 'solr') { + continue; + } + + $container->setParameter('search_engine', 'solr'); + $container->setParameter('solr_dsn', sprintf('http://%s:%d/%s', $endpoint['host'], $endpoint['port'], 'solr')); + } +} From 6462fc33a4b28d269709e4ffd2d5d05bb5d15942 Mon Sep 17 00:00:00 2001 From: Gunnstein Lye Date: Mon, 13 Aug 2018 16:11:50 +0200 Subject: [PATCH 2/3] EZP-29034: Cannot install ezplatform on 1.7 branch (#317) * [Cache] Skip class cache on PHP 7 like Symfony 3.x does by default On PHP 7 in combination with composer optimized aultoad, class cache does not provide any speed benefit anylonger. Only downsides like code breaking on interface changes when doing composer update or deploying new code on old cache. Addtional benefit whith this is for platform.sh where cache is currently placed on shared mount, meaning: - This change will likly speed up p.sh installs - Tiny bit less files on cache mount to clear - The issue mentioned above, given deployes shares cache will be avoided At least for class cache, there are still similar issues in rare cases on proxies generated for lazy services. (cherry picked from commit 5fdf60c698760eda387286d5885ffe67ee32191f) * Disable bootstrap.php.cache on PHP 7 --- web/app.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/app.php b/web/app.php index 3cf1f61511..a5865e164f 100644 --- a/web/app.php +++ b/web/app.php @@ -18,12 +18,12 @@ $useDebugging = $environment === 'dev'; } -// Depending on SYMFONY_CLASSLOADER_FILE use custom class loader, otherwise use bootstrap cache, or autoload in debug +// Depending on SYMFONY_CLASSLOADER_FILE use custom class loader, otherwise use normal autoload and optionally bootstrap cache on PHP 5 when not in debug mode if ($loaderFile = getenv('SYMFONY_CLASSLOADER_FILE')) { require_once $loaderFile; } else { require_once __DIR__ . '/../app/autoload.php'; - if (!$useDebugging) { + if (!$useDebugging && PHP_VERSION_ID < 70000) { require_once __DIR__ . '/../app/bootstrap.php.cache'; } } @@ -36,8 +36,9 @@ $kernel = new AppKernel($environment, $useDebugging); -// we don't want to use the classes cache if we are in a debug session -if (!$useDebugging) { +// we don't want to use the class cache if we are in a debug session +// Also not on PHP7+ where it does not give benefit (if using composer optimize autoload), only downsides remains +if (!$useDebugging && PHP_VERSION_ID < 70000) { $kernel->loadClassCache(); } From cb6794856afa0e00a3ad727e0b71e3b0b865a786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Mon, 20 Aug 2018 09:31:42 +0200 Subject: [PATCH 3/3] [Docker + p.sh] Swith to PHP 7.2 & allow Dockerfiles to take version by env var (#319) --- .env | 4 ++-- .platform.app.yaml | 2 +- doc/docker/Dockerfile-app | 5 +++-- doc/docker/Dockerfile-nginx | 3 ++- doc/docker/base-prod.yml | 4 ++++ doc/docker/distribution.yml | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.env b/.env index b1159d4a9e..e311bfa148 100644 --- a/.env +++ b/.env @@ -10,8 +10,8 @@ DATABASE_PASSWORD=SetYourOwnPassword DATABASE_NAME=ezp ## Docker images (name and version) -PHP_IMAGE=ezsystems/php:7.1-v1 -PHP_IMAGE_DEV=ezsystems/php:7.1-v1-dev +PHP_IMAGE=ezsystems/php:7.2-v1 +PHP_IMAGE_DEV=ezsystems/php:7.2-v1-dev NGINX_IMAGE=nginx:stable MYSQL_IMAGE=healthcheck/mariadb SELENIUM_IMAGE=selenium/standalone-chrome-debug:3.4.0 diff --git a/.platform.app.yaml b/.platform.app.yaml index 10ce545803..e974969a0a 100644 --- a/.platform.app.yaml +++ b/.platform.app.yaml @@ -8,7 +8,7 @@ name: app # The type of the application to build. -type: php:7.1 +type: php:7.2 build: # "none" means we're running composer manually, see build hook flavor: "none" diff --git a/doc/docker/Dockerfile-app b/doc/docker/Dockerfile-app index 9bff30112e..fc9f195448 100644 --- a/doc/docker/Dockerfile-app +++ b/doc/docker/Dockerfile-app @@ -1,4 +1,5 @@ -FROM ezsystems/php:7.1-v1 as builder +ARG PHP_IMAGE=ezsystems/php:7.2-v1 +FROM ${PHP_IMAGE} as builder # This is prod image (for dev use just mount your application as host volume into php image we extend here) ENV SYMFONY_ENV=prod @@ -26,7 +27,7 @@ RUN rm -Rf app/logs/* app/cache/*/* RUN rm -rf web/css web/fonts web/js web/var -FROM ezsystems/php:7.1-v1 +FROM ${PHP_IMAGE} # This is prod image (for dev use just mount your application as host volume into php image we extend here) ENV SYMFONY_ENV=prod diff --git a/doc/docker/Dockerfile-nginx b/doc/docker/Dockerfile-nginx index 37e4c73f84..181fc10d13 100644 --- a/doc/docker/Dockerfile-nginx +++ b/doc/docker/Dockerfile-nginx @@ -1,4 +1,5 @@ -FROM ezsystems/php:7.1-v1 as web-build +ARG PHP_IMAGE=ezsystems/php:7.2-v1 +FROM ${PHP_IMAGE} as web-build ENV SYMFONY_ENV=prod diff --git a/doc/docker/base-prod.yml b/doc/docker/base-prod.yml index e6072179af..ef7ed460be 100644 --- a/doc/docker/base-prod.yml +++ b/doc/docker/base-prod.yml @@ -6,6 +6,8 @@ services: build: context: ../../ dockerfile: ${APP_DOCKER_FILE} + args: + - PHP_IMAGE depends_on: - db environment: @@ -28,6 +30,8 @@ services: build: context: ../../ dockerfile: doc/docker/Dockerfile-nginx + args: + - PHP_IMAGE depends_on: - app ports: diff --git a/doc/docker/distribution.yml b/doc/docker/distribution.yml index 7cb28fe4fb..5a2225372a 100644 --- a/doc/docker/distribution.yml +++ b/doc/docker/distribution.yml @@ -14,7 +14,7 @@ services: - backend app: - image: ezsystems/php:7.1-v1 + image: ${PHP_IMAGE} depends_on: - db - distribution @@ -39,7 +39,7 @@ services: - vardir:/var/www/web/var web: - image: nginx:stable + image: ${NGINX_IMAGE} depends_on: - distribution - app