terminal42/contao-build-tools
Composer 安装命令:
composer require terminal42/contao-build-tools
包简介
Highly opinionated build tool setup for Contao websites.
关键字:
README 文档
README
This is an experimental repository to ease configuration of Contao bundles and websites.
DO NOT USE IN PRODUCTION
Summary
This repo contains some highly opinionated configurations for our extensions and websites.
The CQ and CS tools currently assume that your bundle or application is set up according to
Symfony Best Practice for applications or bundles, meaning there is an src/
directory where all your application or bundle code lives in, but none of the configuration.
Code Quality and Code Style
This package automatically configures the root project for code quality and code style tools.
Whenever you run composer install or composer update on the project, it will also update
the build tools automatically. The following tools are currently available and can be executed
through the composer run command:
Code Style Fixer
The cs-fixer script will fix the coding style in the src/ directory according to the
latest Contao coding standards. Create an ecs.php script in your project
to extend the default configuration.
You can extend the default configuration by adding a ecs.php file to your project root.
Rector
The rector script will automatically upgrade the code to match the latest Contao standards.
You can extend the default configuration by adding a rector.php file to your project root.
PHPStan
The phpstan script will check your code with PHPStan.
You can extend the default configuration by adding a phpstan.neon file to your project root.
Stylelint
The stylelint script will check your CSS formatting with Stylelint.
You can extend the default configuration by adding a .stylelintrc file to your project root.
Ideas
Ideas for additional tools that could be integrated:
- maglnet/composer-require-checker
- https://github.com/VincentLanglet/Twig-CS-Fixer
Continuous Integration
To make sure your code is always up-to-date, you might want
to run all build tools at once but only verify and not fix files.
Run composer run build-tools to do this.
Example GitHub Action
# /.github/workflows/ci.yml name: CI on: push: ~ pull_request: ~ permissions: read-all jobs: ci: uses: 'terminal42/contao-build-tools/.github/workflows/build-tools.yml@main'
Deploying Contao websites
We use Deployer do deploy Contao website to live servers.
To use the Deployer helper, you first need to require Deployer in your composer.json
{
"require-dev": {
"terminal42/contao-build-tools": "dev-main",
"deployer/deployer": "^7.0"
}
}
Example deploy.php
<?php require_once 'vendor/terminal42/contao-build-tools/src/Deployer.php'; use Terminal42\ContaoBuildTools\Deployer; (new Deployer('example.org', 'ssh-user', '/path/to/php')) ->addTarget('prod', '/path/to/deployment', 'https://example.org') ->buildAssets() ->includeSystemModules() ->addUploadPaths( // some additional directory ) ->run() ;
terminal42/contao-build-tools 适用场景与选型建议
terminal42/contao-build-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.07k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2023 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ci」 「contao」 「code-style」 「rector」 「cq」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 terminal42/contao-build-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 terminal42/contao-build-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 terminal42/contao-build-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Axa Zara PHP Code style configuration for `php-cs-fixer` based on PSR-12.
Git hooks for PHP commits QA.
Rector rules for Silverstripe CMS.
Internal rules for rector.
统计信息
- 总下载量: 21.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 17
- 依赖项目数: 80
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-05