uma/composer-psysh 问题修复 & 功能扩展

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

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

uma/composer-psysh

Composer 安装命令:

composer require uma/composer-psysh

包简介

No-frills PsySH-Composer plugin

README 文档

README

A no-frills PsySH-Composer plugin.

In a nutshell, it provides a composer shell subcommand that spawns a Psy Shell with autoload integration when applicable.

composer-psysh in action

Installation

This package is meant to be used as a global requirement for your Composer installation:

$ composer global require uma/composer-psysh

Alternatively it can be required on a per-project basis as a development dependency. Note that in this case the shell subcommand will only be available in the project root.

$ composer require --dev uma/composer-psysh

Composer 2.2 and above

Starting from version 2.2.0 Composer requires plugins to be whitelisted in the composer.json file. After updating to +2.2, the first time you run composer shell it will ask you once if you want to add the plugin to the allow-plugins config section. You'll need to answer Yes.

$ composer shell
uma/composer-psysh contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "uma/composer-psysh" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
Psy Shell v0.11.0 (PHP 8.1.0 — cli) by Justin Hileman
Active Autoloaders:
  /home/marcel/.config/composer/vendor/autoload.php

>>> "oh well"

Usage

composer psy can be run anywhere and will spawn a generic REPL. However, when it runs at the root of a project it will require the vendor/autoload.php script so that the project's classes will be readily available in the shell.

The plugin also defines a couple other aliases: composer repl and composer psy.

Comparison between uma/composer-psysh and ramsey/composer-repl

This package was inspired by ramsey/composer-repl. In fact, it only provides a subset of its features. I decided to write my own version for a couple of reasons:

First, Ben Ramsey's plugin requires PHP 7.4 or later, which is too restrictive for me. uma/composer-psysh allows a wide range of PHP versions: from 5.5 to 8.1. This is pretty similar to the range of versions allowed by PsySH and Composer themselves.

Second, ramsey/composer-repl has additional functionality to integrate PHPUnit into PsySH. Because of this it has a hard dependency on phpunit/phpunit. I wasn't keen on being forced to pull PHPUnit alongside the plugin, especially since I don't need that feature.

Caveats

Only works on Unix environments (for now?)

uma/composer-psysh 适用场景与选型建议

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

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

围绕 uma/composer-psysh 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 3.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-11