2017 © Pedro Peláez
 

library ezsh

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

image

lolautruche/ezsh

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

  • Wednesday, July 12, 2017
  • by lolautruche
  • Repository
  • 4 Watchers
  • 8 Stars
  • 2,221 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

eZ Debug Shell

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)., (*1)

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

Install

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., (*3)

This will install ezsh executable into the ~/.composer/vendor/bin folder., (*4)

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

export PATH=~/.composer/vendor/bin
  

Project install

You can install ezsh binary in your eZ project with Composer:, (*6)

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:, (*7)

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

This will display something like:, (*8)

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., (*9)

Available variables

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

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., (*11)

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

The Versions

12/07 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

12/07 2017

v2.0

2.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

12/07 2017

1.0.x-dev

1.0.9999999.9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

12/07 2017

v1.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

07/07 2015

v0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

02/07 2015

v0.1.3

0.1.3.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

12/11 2014

v0.1.2

0.1.2.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

11/09 2014

v0.1.1

0.1.1.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

11/09 2014

v0.1

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl

02/09 2014

dev-loadContentCommand

dev-loadContentCommand

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

  Sources   Download

MIT

The Requires

 

by Jerome Vieilledent

debug console shell ezpublish interactive repl