承接 bmack/site-importer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bmack/site-importer

Composer 安装命令:

composer require bmack/site-importer

包简介

Imports records from a Yaml file structure into the TYPO3 database

README 文档

README

Built on top of TYPO3 and TYPO3 Console.

Introduction

When it comes to deployment with TYPO3 projects, one tedious issue with TYPO3 is that certain configuration is stored within the database.

While TYPO3 is doing a better job over and over again, there are still some remaining issues left:

sys_domain

Domain records are the most problematic issues. On a multi-site project (multiple websites in one installation), it is very annoying to set up domain records over and over again, and keep them in sync. This little tool will help out to overcome this issue.

sys_template

Basic TypoScript information has to be still loaded from the database.

Since TYPO3 v8, there are good solutions such as the "bolt" extension, which does not need to have a sys_template record anymore.

One change of a single database field inside the page solves the issue for most of our projects.

sys_language

Most of our projects have a lot of langauges, however we add them to production first to ensure that all IDs are the same throughout the system.

Basic Usage

Our deployment setups use composer, .env and TYPO3 console. Deployment runs through ansible or deployer, or completely transparent via platform.sh.

For our needs, we need to add the domain records to all of our projects, depending on the environment, usually a local, testing, staging and production system.

In order to make use of the site importer, require this package via composer

composer req bmack/site-importer

After that, create a yaml file somewhere in your project repository. Our setups usually look like this:

bin/
conf/
web/
var/
vendor/
composer.json
composer.lock

In this case, create a file conf/site_dev.yaml for the local setup. It looks like this

domains:
  mode: "replace"
  table: "sys_domain"
  entries:
    - { domainName: "myproject.local", pid: 1 }
    - { domainName: "myproject-ch.local", pid: 1 }
    - { domainName: "myproject-microsite.local", pid: 13056 }

Other files for staging, production etc. can be created accordingly.

The option mode describes whether to truncate the database table before the entries are added. but could also be set to append or update. If set to append the entries will be written as pure insert without regard whether the record already exists.

If mode is set to replace the table is first truncated, then entries are inserted.

If mode is set to update the following happens:

  • A check is made if the entry contains a uid property. If it does not, the entry is inserted as a new record (like it would happen if mode was set to append).
  • If entry does contain a uid property, the script checks if the record exist in the table and if it does, an SQL update is done to update the record. If it does not exist, it is inserted.

The file accepts more than one table, thus, all language records could be added as well, however this could be done in a generic sites.yaml file which works for all environments.

When deploying, simply call bin/typo3cms siteimport:fromfile conf/site_dev.yaml to import the configured recordsets.

platform.sh

For platform.sh we use bin/typo3cms siteimport:fromfile conf/site_$PLATFORM_BRANCH.yaml in the post-deploy hook to replace the records for a specific branch.

bmack/site-importer 适用场景与选型建议

bmack/site-importer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 84.72k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2017 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 bmack/site-importer 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 21
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2017-12-27