定制 lolautruche/ezsh 二次开发

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

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

lolautruche/ezsh

Composer 安装命令:

composer require lolautruche/ezsh

包简介

Interactive debug shell for eZ Publish 5+ apps. Uses PsySH.

README 文档

README

eZ Debug Shell is an interactive CLI debugger for eZ Platform. It is built on top of PsySH and thus acts as a Read-eval-print-loop (aka repl).

It allows you to debug live code in the context of an eZ Publish application, avoiding to create CLI commands.

Install

Global install (recommended)

composer global require lolautruche/ezsh:^2.0

v1.0 is compatible with eZ Publish 5.3+ while v2.0 is only compatible with eZ Platform.

This will install ezsh executable into the ~/.composer/vendor/bin folder.

For ezsh to work properly without hassle, ensure you have ~.composer/vendor/bin in your $PATH:

export PATH=~/.composer/vendor/bin

Project install

You can install ezsh binary in your eZ project with Composer:

composer require lolautruche/ezsh:^2.0

Usage

Usage:
  ezsh [--siteaccess=<siteaccess_name>] [--env=<env>] [--debug] [--version] [--help] [user_login]

Options:
  --siteaccess    -s SiteAccess to use (e.g. ezdemo_site). If not provided, fallbacks to configured default SiteAccess.
  --env           -e Environment to use (defaults to "dev").
  --debug         -d Use debugging if provided. Debug is always on with "dev" environment.
  --help          -h Display this help message.
  --version       -v Display the PsySH version.
  --config        -c Use an alternate PsySH config file location.
  
  user_login      User login (i.e. username) to use to authenticate against the repository. If not provided, anonymous user will be used.

Important: To be able to use ezsh, you first need to be in your eZ project root:

cd /my/ezpublish/root
ezsh --siteaccess=my_siteaccess

This will display something like:

Debugging eZ Publish using 'my_siteaccess' SiteAccess, in 'dev' environment.
Psy Shell v0.8.9 (PHP 7.0.19 — cli) by Justin Hileman
>>>

Starting from here, you'll be able to evaluate any kind of code in the context of your project.

Available variables

Some variables are already set for you, like the service container, the ConfigResolver and the Repository:

Variable Description
$container Instance of Symfony ServiceContainer. Get your services with it
$kernel Instance of your EzPublishKernel
$repository Instance of the eZ Content repository (to use API)
$contentService The ContentService
$contentTypeService The ContentTypeService
$locationService The LocationService
$searchService The SearchService
$userService The UserService
$configResolver The ConfigResolver (to get SiteAccess aware settings)

Example

From the debug shell, you can define any kind of functions, loops, conditions...
For more information see PsySH documentation.

Debugging eZ Platform using 'default' SiteAccess, in 'dev' environment.

Psy Shell v0.1.12 (PHP 5.5.15 — cli) by Justin Hileman
>>> $repository
=> <eZPublishCoreSignalSlotRepository_000000001c2171540000000109a6622a #000000005890a1640000000113a69e24> {}
>>> $contentInfo = $contentService->loadContentInfo(2926);
=> <eZ\Publish\API\Repository\Values\Content\ContentInfo #2926, Wheelchair Barleywine {
       id: 2926,
       contentTypeId: 40,
       name: "Wheelchair Barleywine",
       sectionId: 1,
       currentVersionNo: 1,
       published: true,
       ownerId: 14,
       modificationDate: <DateTime #00000000588e6c020000000142ceef3a> {
           date: "2014-08-28 10:32:44.000000",
           timezone_type: 3,
           timezone: "Europe/Paris"
       },
       publishedDate: <DateTime #00000000588e6c0c0000000142ceef3a> {
           date: "2014-08-28 10:32:44.000000",
           timezone_type: 3,
           timezone: "Europe/Paris"
       },
       alwaysAvailable: 0,
       remoteId: "beer-d7nEsv",
       mainLanguageCode: "eng-GB",
       mainLocationId: "2928"
   }

>>> $configResolver->getParameter('languages');
=> [
       "eng-GB"
   ]

lolautruche/ezsh 适用场景与选型建议

lolautruche/ezsh 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.55k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2014 年 08 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「debug」 「console」 「shell」 「interactive」 「REPL」 「ezpublish」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-28