luoxiaojun1992/yii2-tinker

v0.1.4 2017-11-24 05:57 UTC

README

Build Status

Features

A console debugger like laravel artisan tinker

  • REPL
  • Powerful Dumper

Installation

composer require "luoxiaojun1992/yii2-tinker:*"

Configuration

config/console.php

...
$config = [
    ...
    'controllerMap' => [
        ...
        'tinker' => [ // Tinker command line.
            'class' => \Yii2Tinker\TinkerController::class,
        ],
        ...
    ],
    ...
];
...

Usage

execute ./yii tinker in your application's root folder

Example:

Psy Shell v0.8.1 (PHP 7.0.14 — cli) by Justin Hileman
>>> Yii::$app->params['adminEmail']
=> "admin@example.com"
>>> dd([1=>'a', 2=>'b', 3=>'c'])
array:3 [
  1 => "a"
  2 => "b"
  3 => "c"
]
>>>