定制 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"
   ]

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固