From 4a3ec0ca3f7d0ca8776a6ee7f2a2615234395eb8 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Mon, 16 Jul 2018 00:09:33 +0200 Subject: Cake 3.6.7 fresh install --- fai_gestion/src/Shell/ConsoleShell.php | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 fai_gestion/src/Shell/ConsoleShell.php (limited to 'fai_gestion/src/Shell/ConsoleShell.php') diff --git a/fai_gestion/src/Shell/ConsoleShell.php b/fai_gestion/src/Shell/ConsoleShell.php new file mode 100644 index 0000000..2eb9395 --- /dev/null +++ b/fai_gestion/src/Shell/ConsoleShell.php @@ -0,0 +1,81 @@ +err('Unable to load Psy\Shell.'); + $this->err(''); + $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 --dev psy/psysh'); + $this->err(''); + + return self::CODE_ERROR; + } + + $this->out("You can exit with `CTRL-C` or `exit`"); + $this->out(''); + + Log::drop('debug'); + Log::drop('error'); + $this->_io->setLoggers(false); + restore_error_handler(); + restore_exception_handler(); + + $psy = new PsyShell(); + $psy->run(); + } + + /** + * Display help for this console. + * + * @return \Cake\Console\ConsoleOptionParser + */ + public function getOptionParser() + { + $parser = new ConsoleOptionParser('console'); + $parser->setDescription( + 'This shell provides a REPL that you can use to interact ' . + 'with your application in an interactive fashion. You can use ' . + '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 psysh installed for this Shell to work.' + ); + + return $parser; + } +} -- cgit v1.1