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 | namespace App\Shell; |
||||
0 ignored issues
–
show
|
|||||
3 | |||||
4 | use Cake\Console\Shell; |
||||
5 | use Cake\Filesystem\Folder; |
||||
0 ignored issues
–
show
|
|||||
6 | use Cake\Filesystem\File; |
||||
7 | use Cake\Core\Configure; |
||||
8 | use Cake\Core\Configure\Engine\PhpConfig; |
||||
0 ignored issues
–
show
|
|||||
9 | |||||
10 | class InstallShell extends Shell |
||||
0 ignored issues
–
show
The class
Cake\Console\Shell has been deprecated: 3.6.0 ShellDispatcher and Shell will be removed in 5.0
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
11 | { |
||||
0 ignored issues
–
show
|
|||||
12 | |||||
13 | public function main() |
||||
0 ignored issues
–
show
|
|||||
14 | { |
||||
0 ignored issues
–
show
|
|||||
15 | $this->out('FortuneCookies installation'); |
||||
16 | $this->hr(); |
||||
17 | $this->out('This procedure will output a file called app_local.php'); |
||||
18 | $this->out('to store Security Salt and Database connection information'); |
||||
19 | |||||
20 | // Salt |
||||
0 ignored issues
–
show
|
|||||
21 | $this->hr(); |
||||
22 | $this->out('Configure Security Salt'); |
||||
23 | $this->out('A Security Salt is a random string used to encrypt sensitive data inside this app.'); |
||||
24 | $salt = $this->in('Type a string:'); |
||||
25 | Configure::write('Security.salt', $salt); |
||||
26 | // Database\Connection |
||||
27 | // Admin account |
||||
28 | |||||
0 ignored issues
–
show
|
|||||
29 | |||||
30 | if(!Configure::read('Security.salt')) |
||||
0 ignored issues
–
show
|
|||||
31 | { |
||||
32 | $salt = $this->in('Salt:'); |
||||
0 ignored issues
–
show
|
|||||
33 | } |
||||
34 | |||||
35 | Configure::write('debug', false); |
||||
36 | Configure::write('Datasources.default.className', 'Cake\Database\Connection'); |
||||
37 | Configure::write('Datasources.default.driver', 'Cake\Database\Driver\Mysql'); |
||||
38 | Configure::write('Datasources.default.persistent', false); |
||||
39 | Configure::write('Datasources.default.host', 'localhost'); |
||||
40 | Configure::write('Datasources.default.username', 'root'); |
||||
41 | Configure::write('Datasources.default.password', 'semaphoredb'); |
||||
42 | Configure::write('Datasources.default.database', 'fc_test'); |
||||
43 | Configure::write('Datasources.default.encoding', 'utf8'); |
||||
44 | Configure::write('Datasources.default.timezone', 'UTC'); |
||||
45 | Configure::write('Datasources.default.flags', []); |
||||
46 | Configure::write('Datasources.default.cacheMetadata', true); |
||||
47 | Configure::write('Datasources.default.log', false); |
||||
48 | Configure::write('Datasources.default.quoteIdentifiers', false); |
||||
49 | Configure::write('Datasources.default.url', env('DATABASE_URL', null)); |
||||
50 | $file = new File('config/app_local.php', false); |
||||
0 ignored issues
–
show
The class
Cake\Filesystem\File has been deprecated: 4.0.0 Will be removed in 5.0.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
51 | if(!$file->exists()) { |
||||
0 ignored issues
–
show
|
|||||
52 | if($ris = Configure::dump('app_local', 'default')) { |
||||
0 ignored issues
–
show
|
|||||
53 | $this->out("Wrote config file app_local.php"); |
||||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
Wrote config file app_local.php does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||||
54 | } |
||||
55 | } |
||||
0 ignored issues
–
show
|
|||||
56 | $file->close(); |
||||
57 | } |
||||
0 ignored issues
–
show
|
|||||
58 | } |
||||
59 |