err('Unable to load Psy\Shell.'); $io->err(''); $io->err('Make sure you have installed psysh as a dependency,'); $io->err('and that Psy\Shell is registered in your autoloader.'); $io->err(''); $io->err('If you are using composer run'); $io->err(''); $io->err('$ php composer.phar require --dev psy/psysh'); $io->err(''); return static::CODE_ERROR; } $io->out("You can exit with `CTRL-C` or `exit`"); $io->out(''); Log::drop('debug'); Log::drop('error'); $io->setLoggers(false); restore_error_handler(); restore_exception_handler(); $psy = new PsyShell(); $psy->run(); } /** * Display help for this console. * * @param \Cake\Console\ConsoleOptionParser $parser The parser to update * @return \Cake\Console\ConsoleOptionParser */ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser { $parser->setDescription( 'This shell provides a REPL that you can use to interact with ' . 'your application in a command line designed to run PHP code. ' . 'You can use it to run adhoc queries with your models, or ' . 'explore the features of CakePHP and your application.' . "\n\n" . 'You will need to have psysh installed for this Shell to work.' ); return $parser; } }