diff --git a/composer.json b/composer.json index afa4b4d338..e8469cd5f1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "cakephp/plugin-installer": "*" }, "require-dev": { - "d11wtq/boris": "1.0.*", + "psy/psysh": "@stable", "cakephp/debug_kit": "3.0.*-dev", "cakephp/bake": "dev-master" }, diff --git a/src/Shell/ConsoleShell.php b/src/Shell/ConsoleShell.php index 20ad22a546..d8ccd7e611 100644 --- a/src/Shell/ConsoleShell.php +++ b/src/Shell/ConsoleShell.php @@ -14,10 +14,10 @@ */ namespace App\Shell; -use Boris\Boris; use Cake\Console\ConsoleOptionParser; use Cake\Console\Shell; use Cake\Log\Log; +use Psy\Shell as PsyShell; /** * Simple console wrapper around Boris. @@ -32,25 +32,21 @@ class ConsoleShell extends Shell */ public function main() { - if (!class_exists('Boris\Boris')) { - $this->err('Unable to load Boris\Boris.'); + if (!class_exists('Psy\Shell')) { + $this->err('Unable to load Psy\Shell.'); $this->err(''); - $this->err('Make sure you have installed boris as a dependency,'); - $this->err('and that Boris\Boris is registered in your autoloader.'); + $this->err('Make sure you have installed psysh as a dependency,'); + $this->err('and that Psy\Shell is registered in your autoloader.'); $this->err(''); $this->err('If you are using composer run'); $this->err(''); - $this->err('$ php composer.phar require d11wtq/boris'); + $this->err('$ php composer.phar require --dev psy/psysh'); $this->err(''); return 1; } - if (!function_exists('pcntl_signal')) { - $this->err('No process control functions.'); - $this->err(''); - $this->err('You are missing the pcntl extension, the interactive console requires this extension.'); - return 2; - } - $this->out('You can exit with CTRL-D'); + + $this->out("You can exit with `CTRL-C` or `exit`"); + $this->out(''); Log::drop('debug'); Log::drop('error'); @@ -58,8 +54,8 @@ public function main() restore_error_handler(); restore_exception_handler(); - $boris = new Boris('app > '); - $boris->start(); + $psy = new PsyShell(); + $psy->run(); } /** @@ -76,9 +72,7 @@ public function getOptionParser() 'it to run adhoc queries with your models, or experiment ' . 'and explore the features of CakePHP and your application.' . "\n\n" . - 'You will need to have boris installed for this Shell to work. ' . - 'Boris is known to not work well on windows due to dependencies on ' . - 'readline and posix.' + 'You will need to have psysh installed for this Shell to work.' ); return $parser; }