This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | declare(strict_types=1); |
||
3 | |||
4 | /** |
||
0 ignored issues
–
show
|
|||
5 | * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) |
||
6 | * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
||
0 ignored issues
–
show
|
|||
7 | * |
||
8 | * Licensed under The MIT License |
||
9 | * For full copyright and license information, please see the LICENSE.txt |
||
10 | * Redistributions of files must retain the above copyright notice. |
||
11 | * |
||
12 | * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
||
0 ignored issues
–
show
|
|||
13 | * @link https://cakephp.org CakePHP(tm) Project |
||
0 ignored issues
–
show
|
|||
14 | * @since 3.0.0 |
||
0 ignored issues
–
show
|
|||
15 | * @license https://opensource.org/licenses/mit-license.php MIT License |
||
0 ignored issues
–
show
|
|||
16 | */ |
||
0 ignored issues
–
show
|
|||
17 | namespace App\Command; |
||
18 | |||
19 | use Cake\Command\Command; |
||
20 | use Cake\Console\Arguments; |
||
21 | use Cake\Console\ConsoleIo; |
||
22 | use Cake\Console\ConsoleOptionParser; |
||
23 | use Cake\Log\Log; |
||
24 | use Psy\Shell as PsyShell; |
||
25 | |||
26 | /** |
||
27 | * Simple console wrapper around Psy\Shell. |
||
28 | */ |
||
0 ignored issues
–
show
|
|||
29 | class ConsoleCommand extends Command |
||
30 | { |
||
0 ignored issues
–
show
|
|||
31 | /** |
||
32 | * Start the Command and interactive console. |
||
33 | * |
||
34 | * @param \Cake\Console\Arguments $args The command arguments. |
||
0 ignored issues
–
show
|
|||
35 | * @param \Cake\Console\ConsoleIo $io The console io |
||
0 ignored issues
–
show
|
|||
36 | * @return int|null|void The exit code or null for success |
||
0 ignored issues
–
show
|
|||
37 | */ |
||
38 | public function execute(Arguments $args, ConsoleIo $io) |
||
0 ignored issues
–
show
|
|||
39 | { |
||
0 ignored issues
–
show
|
|||
40 | if (!class_exists('Psy\Shell')) { |
||
0 ignored issues
–
show
|
|||
41 | $io->err('<error>Unable to load Psy\Shell.</error>'); |
||
42 | $io->err(''); |
||
43 | $io->err('Make sure you have installed psysh as a dependency,'); |
||
44 | $io->err('and that Psy\Shell is registered in your autoloader.'); |
||
45 | $io->err(''); |
||
46 | $io->err('If you are using composer run'); |
||
47 | $io->err(''); |
||
48 | $io->err('<info>$ php composer.phar require --dev psy/psysh</info>'); |
||
49 | $io->err(''); |
||
50 | |||
51 | return static::CODE_ERROR; |
||
52 | } |
||
53 | |||
54 | $io->out('You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>'); |
||
55 | $io->out(''); |
||
56 | |||
57 | Log::drop('debug'); |
||
58 | Log::drop('error'); |
||
59 | $io->setLoggers(false); |
||
60 | restore_error_handler(); |
||
61 | restore_exception_handler(); |
||
62 | |||
63 | $psy = new PsyShell(); |
||
64 | $psy->run(); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Display help for this console. |
||
69 | * |
||
70 | * @param \Cake\Console\ConsoleOptionParser $parser The parser to update |
||
0 ignored issues
–
show
|
|||
71 | * @return \Cake\Console\ConsoleOptionParser |
||
0 ignored issues
–
show
|
|||
72 | */ |
||
73 | public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser |
||
74 | { |
||
0 ignored issues
–
show
|
|||
75 | $parser->setDescription( |
||
76 | 'This shell provides a REPL that you can use to interact with ' . |
||
77 | 'your application in a command line designed to run PHP code. ' . |
||
78 | 'You can use it to run adhoc queries with your models, or ' . |
||
79 | 'explore the features of CakePHP and your application.' . |
||
80 | "\n\n" . |
||
81 | 'You will need to have psysh installed for this Shell to work.' |
||
82 | ); |
||
83 | |||
84 | return $parser; |
||
85 | } |
||
0 ignored issues
–
show
|
|||
86 | } |
||
87 |