定制 netlogix/errorhandler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netlogix/errorhandler

Composer 安装命令:

composer require netlogix/errorhandler

包简介

README 文档

README

This package allows you to generate static error pages by using the content of Neos pages. These static files will be used for error handling in Flow & Neos depending on their configuration.

You can also use these files as ErrorDocument in your webserver.

Install package

composer require netlogix/errorhandler

Configuration

Option 1: Add error pages manually as document nodes.

Create a custom document node, which uses the Netlogix.ErrorHandler.NodeTypes:Mixin.ErrorPage mixin.

Every child page of this error page as well as child pages of siblings of this error age are covered by this error page.

Every error counts for its exact dimension and for the error codes configured within that page node.

A dynamic error page is omitted, if no error code is assigned.

There still needs to be a storage folder where cached error pages will be placed.

Netlogix:
  ErrorHandler:

    # File path where this error page should be saved to. Available variables are `site`, `dimensions` and `node`.
    destination: '${"/var/www/default/" + site + "/" + dimensions + "/" + node + ".html"}'

Option 2: Provide error pages via yaml

Provide configuration for every site and status code you need:

Netlogix:
  ErrorHandler:
    pages:
      # siteNodeName of all Sites that you want to generate error pages for

      'my-site-without-dimensions':
        -
          # The status codes this error page is generated for
          matchingStatusCodes: [404, 410]

          # Dimensions to use for this error page. Use empty array if no dimensions are configured
          dimensions: []

          # Node identifier of documentNode to use for rendering
          source: '#550e8400-e29b-11d4-a716-446655440000'

          # File path where this error page should be saved to. Available variables are `site` and `dimensions`
          destination: '${"/var/www/default/mysite/errorpages/404.html"}'

        -
          # You can also configure path prefixes so some site areas have different error pages. Make sure to adjust the destination path accordingly.
          pathPrefixes: ['/some-special-path']

          # The status codes this error page is generated for
          matchingStatusCodes: [404, 410]

          # Dimensions to use for this error page. Use empty array if no dimensions are configured
          dimensions: []

          # Node identifier of documentNode to use for rendering
          source: '#f7c8d757-391a-4a85-bdb5-81df56d5e2c0'

          # File path where this error page should be saved to. Available variables are site and dimensions
          destination: '${"/var/www/default/mysite/errorpages/404-some-special-path.html"}'

      'my-site-with-dimensions':
        -
          matchingStatusCodes: [500]

          # The first path segment that determines the dimensions. Use empty string if no dimensions are configured
          dimensionPathSegment: 'en_US'

          # Dimensions to use for this error page. Use empty array if no dimensions are configured
          dimensions:
            language: ['en_US', 'en']

          source: '#550e8400-e29b-11d4-a716-446655440000'
          destination: '${"%FLOW_PATH_DATA%Persistent/ErrorPages/" + site + "-" + dimensions + "-500.html"}'

Generate error pages

To generate the static error pages, run the following Flow command:

./flow errorpage:generate --verbose

This will loop all error pages and download them to their destination. Depending on how often the content of the configured Neos pages changes, you might want to do this during deployment or periodically using a cronjob.

Show current configuration

./flow errorpage:showconfiguration

This call responds in YAML format, although not all settings are actually given in YAML settings. Instead, the result will be the merged result of both, YAML configuration and node based configuration.

netlogix/errorhandler 适用场景与选型建议

netlogix/errorhandler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.97k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 netlogix/errorhandler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 netlogix/errorhandler 我们能提供哪些服务?
定制开发 / 二次开发

基于 netlogix/errorhandler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 19.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-26