yannoff/handyman

A basic REPL for symfony applications

1.0.0 2023-10-19 08:30 UTC

README

A basic REPL for symfony applications

Latest Stable Version Total Downloads License

Installation

Using composer:

composer require --dev yannoff/handyman

Usage

Call the REPL script from the application top-level directory:

vendor/bin/handyman

Depending on the main composer.json config, a link to the script may be available in the bin/ directory.

Example

PHP> print_r(get_class_methods(self::get('slugger')));;
Array
(
    [0] => __construct
    [1] => setLocale
    [2] => getLocale
    [3] => slug
)

PHP> echo self::get('slugger')->slug('this is my text')  
PHP> // Note: to trigger eval, line must end with a double semi-colon (;;)
PHP> ;;
this-is-my-text
PHP> 

Code will be eval'd as soon as two semi-colons (;;) are detected in the line end.

Options

--kernel

Alternative application's kernel fully-qualfied class name (instead of App\Kernel)

--working-dir

Optional override for the %kernel.project_dir% value

--verbose

Turn on verbose mode

License

Licensed under the MIT Licence.