contextualcode/platformsh-siteaccess-matcher-bundle

Platform.sh 采用 eZ Platform Map\Host 站点访问匹配器。

v2.0.2 2020-03-28 15:43 UTC

README

Paltform.sh 允许您拥有多个环境(例如:测试、特性特定等)。但是,这些环境将使用自动生成的 URL。如果您在 eZ Platform 安装中有多个 siteaccess 并且使用 Map\Host 匹配器,可能会出现问题。此捆绑包将覆盖默认的 Map\Host 并尝试从 Platform.sh 环境变量中提取正确的域名。这解决了该问题。

安装

  1. 通过 composer 安装 contextualcode/platformsh-siteaccess-matcher-bundle
     $ composer require contextualcode/platformsh-siteaccess-matcher-bundle
    
  2. config/bundles.php 中启用此捆绑包
     return [
         ...
         ContextualCode\PlatformShSiteAccessMatcherBundle\ContextualCodePlatformShSiteAccessMatcherBundle::class => ['all' => true],
     ]
    
  3. .env 中添加 SITE_ACCESS_MATCHER_DOMAINS_PREFIX 变量(当自定义 Platform.sh 环境同步到故障转移服务器时使用)
     ###> contextualcode/platformsh-siteaccess-matcher-bundle ###
     SITE_ACCESS_MATCHER_DOMAINS_PREFIX=
     ###< contextualcode/platformsh-siteaccess-matcher-bundle ###
    
  4. 提交并部署此更改到 Platform.sh
     $ git add composer.json composer.lock config/bundles.php .env
     $ git commit -m "Installing platformsh-siteaccess-matcher-bundle"
     $ git push platform master
    
  5. 完成!所有 siteaccess 都将在所有新 Platform.sh 环境中与自动生成的 URL 正确匹配。