consolidation/site-process 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

consolidation/site-process

Composer 安装命令:

composer require consolidation/site-process

包简介

A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.

README 文档

README

A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.

ci scrutinizer codecov License

Overview

Site Process is a thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.

For comparison purposes, the Process object may be created to run an application on the local system using the standard Symfony Process Component API like so:

$process = new Process(['ls', '-lsa']);

Similarly, a remote call can be done using the general-purpose SiteProcess API, which is accessible via the ProcessManager object:

$processManager = ProcessManager::createDefault();
$process = $processManager->siteProcess($site_alias, ['ls', '-lsa', '{root}']);

In this example, if $site_alias represents a site on the same system, then the ls -lsa command will run locally. If, on the other hand, it represents a remote site, then the ls -lsa command will be wrapped in an ssh call to the remote system. In either case, the {root} reference will be replaced with the value of the attribute of the site alias named root. An exception will be thrown if the named attribute does not exist.

Options may also be specified as an associative array provided as a third parameter:

$process = $processManager->siteProcess($site_alias, ['git', 'status'], ['untracked-files' => 'no']);

This is equivalent to:

$process = $processManager->siteProcess($site_alias, ['git', '--untracked-files=no', 'status']);

Transports

SSH

Wraps a command so that it runs on a remote system via the ssh cli.

Example:

local:
  host: localhost
  uri: http://localhost
  ssh:
    options: -o PasswordAuthentication=no -i $HOME/.ssh/id_rsa

Vagrant

Wraps commands so they run with vagrant ssh -c.

Example:

local:
  uri: http://localhost
  vagrant:

Docker Compose

Wraps a command so that it runs on a remote system via docker-compose.

Example:

local:
  host: localhost
  uri: http://localhost
  docker:
    service: drupal
    compose:
      version: 1
      options: --project dockerComposeProjectName --file docker-compose.yml --project-directory dockerComposeWorkDir
    exec:
      options: --user www-data

The above would execute commands prefixed with:

docker-compose --project dockerComposeProjectName --file docker-compose.yml --project-directory dockerComposeWorkDir exec --user www-data -T drupal

docker.project and compose.options --project do the same thing, docker.project existed before options.

docker.service is the exact name of the service as it appears in docker-compose.yml

docker.compose.version defaults to 1. Set to 2 to use the new syntax:

docker compose --project dockerComposeProjectName --file docker-compose.yml --project-directory dockerComposeWorkDir exec --user www-data -T drupal

The default behaviour is to use docker-compose exec to invoke a command on a running container. You can change this to use docker-compose run for containers which by default are not running, with the property compose.command.

Check the docker-compose manual for all available options.

Local

Runs the command on the local system.

Running the tests

The test suite may be run locally by way of some simple composer scripts:

Test Command
Run all tests composer test
PHPUnit tests composer unit
PHP linter composer lint
Code style composer cs
Fix style errors composer cbf

Deployment

  • Run composer release

Contributing

Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the releases page.

Branch Symfony Versions PHP Versions
main (5.x) ^5 ^6
4.x ^4 7.1+
2.x ^2 ^3

Note that all 3.x releases of consolidation/site-process were skipped simply to align the 4.x versions with Symfony 4.x support.

Note that the API of consolidation/site-process itself is compatible between the 2.x and 4.x versions, so most clients that work with both Symfony 3 and Symfony 4 should be able to require "consolidation/site-process": "^2 | ^4" without problems.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

consolidation/site-process 适用场景与选型建议

consolidation/site-process 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48.52M 次下载、GitHub Stars 达 53, 最近一次更新时间为 2018 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 48.52M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 54
  • 点击次数: 28
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 53
  • Watchers: 3
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-23