定制 survos/installer 二次开发

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

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

survos/installer

最新稳定版本:2.1.7

Composer 安装命令:

composer require survos/installer

包简介

Composer plugin for installing configuration files and updating .env and .gitignore, based on survos/installer

README 文档

README

By survos

This plugin was forked from https://github.com/endroid/installer, and functionality to update the .env and .gitignore files was added. It is a simple way to get some of the functionality of https://github.com/symfony/recipes-contrib but is a bit easier to set up, since the bundle configuration is in the bundle itself, rather than a separate repo.

In short, this utility modifies the application when a bundle is installed by reading the .installer/symfony directory and

  • copy the config/packages/.yaml and config/routes/.yaml files.
  • add env.txt to .env
  • add from gitignore.txt to .gitignore
  • display the post-install contents

An experimental feature was to put all the actions above into a single manifest.yaml file and parse it. If we have a bundle that needs this feature, we can implement it.

bundles:
  Survos\Bundle\SurvosFlickrBundle: [all]
copy-from-recipe:
  config/: '%CONFIG_DIR%/'
  src/: '%SRC_DIR%/'
env: |
  FLICKR_API_KEY=
  FLICKR_SECRET=
copy:
  - filename: config/packages/survos_flickr.yaml
    content: |
      survos_flickr:
        api_key: '%env(FLICKR_API_KEY)%'
        secret: '%env(FLICKR_SECRET)%'
  - filename: config/routes/survos_flickr.yaml
    content: |
      survos_flickr:
        resource: '@SurvosFlickrBundle/config/routes.yaml'
        prefix: '/admin/flickr'

Composer plugin for installing configuration files. The installer automatically detects the project type in which your library is installed and installs the corresponding configuration files from your package.

Read the blog for more information on why this plugin was originally created.

Installation

composer config allow-plugins.survos/installer true

# dev
composer config repositories.survos_installer '{"type": "path", "url": "../installer"}' 
composer require survos/installer:dev-main

Production

composer require survos/installer

Usage

Add the configuration files you want to be copied upon installation and update of the package to the .installer directory in the root of your package. The files will be copied to the corresponding directories in the project.

It tried to use the same structure as the Symfony recipes-config, in the recipe folder at the root of a bundle. It uses manifest.yaml instead of manifest.json

fun-bundle
    └── recipe
        ├── config
        │ ├── packages
        │ │ └── fun.yaml
        │ └── routes
        │     └── fun.yaml
        ├── manifest.yaml
        └── post-install.txt
# manifest.yaml
fun:
  bundles:
    'Vendor\\Bundle\\VendorFunBundle\\FunBundle': all
    "copy-from-recipe": 
        "config/": "%CONFIG_DIR%/"
    "env": 
        "FUN_ID": "",
        "FUN_SECRET": ""
    ".gitignore":
      - /fun-temp-files
.recipe
    symfony
        env.txt
        gitignore.txt
        post-install.txt
        config
            packages
                package_name.yaml
            routes
                package_name.yaml

Please note that the installer will only copy files that are not yet present in the project to make sure user made changes will not be overwritten. If you want the latest default configuration just remove the files locally before update.

Disabling auto installation for a package

Generally you want the files to be installed automatically but if you experience issues with the installer or just don't want some package to be auto installed you can specify this via your composer.json.

"extra": {
    "survos": {
        "installer": {
            "enabled": false,
            "exclude": [
                "survos/asset",
                "survos/embed"
            ]
        }
    }
}

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatible changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

survos/installer 适用场景与选型建议

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 3.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 13
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-18