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.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * @author Victor Dubiniuk <[email protected]> |
||
4 | * |
||
5 | * @copyright Copyright (c) 2015, ownCloud, Inc. |
||
6 | * @license AGPL-3.0 |
||
7 | * |
||
8 | * This code is free software: you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU Affero General Public License, version 3, |
||
10 | * as published by the Free Software Foundation. |
||
11 | * |
||
12 | * This program is distributed in the hope that it will be useful, |
||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | * GNU Affero General Public License for more details. |
||
16 | * |
||
17 | * You should have received a copy of the GNU Affero General Public License, version 3, |
||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> |
||
19 | * |
||
20 | */ |
||
21 | |||
22 | use Pimple\Container; |
||
23 | use GuzzleHttp\Client; |
||
24 | use Owncloud\Updater\Console\Application; |
||
25 | use Owncloud\Updater\Utils\AppManager; |
||
26 | use Owncloud\Updater\Utils\Checkpoint; |
||
27 | use Owncloud\Updater\Utils\ConfigReader; |
||
28 | use Owncloud\Updater\Utils\Fetcher; |
||
29 | use Owncloud\Updater\Utils\FilesystemHelper; |
||
30 | use Owncloud\Updater\Utils\Locator; |
||
31 | use Owncloud\Updater\Utils\OccRunner; |
||
32 | use Owncloud\Updater\Utils\Registry; |
||
33 | use Owncloud\Updater\Command\BackupDataCommand; |
||
34 | use Owncloud\Updater\Command\BackupDbCommand; |
||
35 | use Owncloud\Updater\Command\CheckpointCommand; |
||
36 | use Owncloud\Updater\Command\CheckSystemCommand; |
||
37 | use Owncloud\Updater\Command\CleanCacheCommand; |
||
38 | use Owncloud\Updater\Command\DetectCommand; |
||
39 | use Owncloud\Updater\Command\ExecuteCoreUpgradeScriptsCommand; |
||
40 | use Owncloud\Updater\Command\InfoCommand; |
||
41 | use Owncloud\Updater\Command\MaintenanceModeCommand; |
||
42 | use Owncloud\Updater\Command\PostUpgradeCleanupCommand; |
||
43 | use Owncloud\Updater\Command\PostUpgradeRepairCommand; |
||
44 | use Owncloud\Updater\Command\PreUpgradeRepairCommand; |
||
45 | use Owncloud\Updater\Command\RestartWebServerCommand; |
||
46 | use Owncloud\Updater\Command\UpdateConfigCommand; |
||
47 | use Owncloud\Updater\Command\StartCommand; |
||
48 | |||
49 | $c = new Container(); |
||
50 | |||
51 | /* |
||
52 | $c['parameters'] = [ |
||
53 | 'locator.file' => 'locator.xml' |
||
54 | ]; |
||
55 | */ |
||
56 | |||
57 | $c['guzzle.httpClient'] = function($c){ |
||
0 ignored issues
–
show
|
|||
58 | return new Client(); |
||
59 | }; |
||
60 | |||
61 | $c['utils.locator'] = function($c){ |
||
0 ignored issues
–
show
|
|||
62 | return new Locator(CURRENT_DIR); |
||
63 | }; |
||
64 | |||
65 | $c['utils.occrunner'] = function($c){ |
||
66 | $disabled = explode(',', ini_get('disable_functions')); |
||
67 | $isProcOpenEnabled = function_exists('proc_open') && !in_array('proc_open', $disabled); |
||
68 | return new OccRunner($c['utils.locator'], $isProcOpenEnabled && IS_CLI); |
||
69 | }; |
||
70 | |||
71 | $c['utils.registry'] = function($c){ |
||
0 ignored issues
–
show
|
|||
72 | return new Registry(); |
||
73 | }; |
||
74 | |||
75 | $c['utils.appmanager'] = function($c){ |
||
76 | return new AppManager($c['utils.occrunner']); |
||
77 | }; |
||
78 | $c['utils.filesystemhelper'] = function($c){ |
||
0 ignored issues
–
show
|
|||
79 | return new FilesystemHelper(); |
||
80 | }; |
||
81 | $c['utils.checkpoint'] = function($c){ |
||
82 | return new Checkpoint($c['utils.locator'], $c['utils.filesystemhelper']); |
||
83 | }; |
||
84 | $c['utils.configReader'] = function($c){ |
||
85 | return new ConfigReader($c['utils.occrunner']); |
||
86 | }; |
||
87 | $c['utils.fetcher'] = function($c){ |
||
88 | return new Fetcher($c['guzzle.httpClient'], $c['utils.locator'], $c['utils.configReader']); |
||
89 | }; |
||
90 | |||
91 | $c['command.backupData'] = function($c){ |
||
0 ignored issues
–
show
|
|||
92 | return new BackupDataCommand(); |
||
93 | }; |
||
94 | $c['command.backupDb'] = function($c){ |
||
0 ignored issues
–
show
|
|||
95 | return new BackupDbCommand(); |
||
96 | }; |
||
97 | $c['command.checkpoint'] = function($c){ |
||
0 ignored issues
–
show
|
|||
98 | return new CheckpointCommand(); |
||
99 | }; |
||
100 | $c['command.checkSystem'] = function($c){ |
||
0 ignored issues
–
show
|
|||
101 | return new CheckSystemCommand(); |
||
102 | }; |
||
103 | $c['command.cleanCache'] = function($c){ |
||
0 ignored issues
–
show
|
|||
104 | return new CleanCacheCommand(); |
||
105 | }; |
||
106 | $c['command.detect'] = function($c){ |
||
107 | return new DetectCommand($c['utils.fetcher'], $c['utils.configReader']); |
||
108 | }; |
||
109 | $c['command.executeCoreUpgradeScripts'] = function($c){ |
||
110 | return new ExecuteCoreUpgradeScriptsCommand($c['utils.occrunner']); |
||
111 | }; |
||
112 | $c['command.info'] = function($c){ |
||
0 ignored issues
–
show
|
|||
113 | return new InfoCommand(); |
||
114 | }; |
||
115 | $c['command.maintenanceMode'] = function($c){ |
||
116 | return new MaintenanceModeCommand($c['utils.occrunner']); |
||
117 | }; |
||
118 | $c['command.postUpgradeCleanup'] = function($c){ |
||
0 ignored issues
–
show
|
|||
119 | return new PostUpgradeCleanupCommand(); |
||
120 | }; |
||
121 | $c['command.postUpgradeRepair'] = function($c){ |
||
0 ignored issues
–
show
|
|||
122 | return new PostUpgradeRepairCommand(); |
||
123 | }; |
||
124 | $c['command.preUpgradeRepair'] = function($c){ |
||
0 ignored issues
–
show
|
|||
125 | return new PreUpgradeRepairCommand(); |
||
126 | }; |
||
127 | $c['command.restartWebServer'] = function($c){ |
||
0 ignored issues
–
show
|
|||
128 | return new RestartWebServerCommand(); |
||
129 | }; |
||
130 | $c['command.updateCoreConfig'] = function($c){ |
||
0 ignored issues
–
show
|
|||
131 | return new UpdateConfigCommand(); |
||
132 | }; |
||
133 | $c['command.start'] = function($c){ |
||
0 ignored issues
–
show
|
|||
134 | return new StartCommand(); |
||
135 | }; |
||
136 | |||
137 | $c['commands'] = function($c){ |
||
138 | return [ |
||
139 | $c['command.backupData'], |
||
140 | $c['command.backupDb'], |
||
141 | $c['command.checkpoint'], |
||
142 | $c['command.checkSystem'], |
||
143 | $c['command.cleanCache'], |
||
144 | $c['command.detect'], |
||
145 | $c['command.executeCoreUpgradeScripts'], |
||
146 | $c['command.info'], |
||
147 | $c['command.maintenanceMode'], |
||
148 | $c['command.postUpgradeCleanup'], |
||
149 | $c['command.postUpgradeRepair'], |
||
150 | $c['command.preUpgradeRepair'], |
||
151 | $c['command.restartWebServer'], |
||
152 | $c['command.updateCoreConfig'], |
||
153 | $c['command.start'], |
||
154 | ]; |
||
155 | }; |
||
156 | |||
157 | $c['application'] = function($c){ |
||
158 | $application = new Application('ownCloud updater', '1.0.1'); |
||
159 | $application->setContainer($c); |
||
160 | $application->addCommands($c['commands']); |
||
161 | $application->setDefaultCommand($c['command.start']->getName()); |
||
162 | return $application; |
||
163 | }; |
||
164 | |||
165 | return $c; |
||
166 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.