1 | <?php namespace Arcanesoft\Foundation\ViewComposers\System; |
||
2 | |||
3 | use Illuminate\View\View; |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | /** |
||
6 | * Class ServerRequirementsComposer |
||
7 | * |
||
8 | * @package Arcanesoft\Foundation\ViewComposers\System |
||
9 | * @author ARCANEDEV <[email protected]> |
||
10 | */ |
||
11 | class ServerRequirementsComposer |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Constants |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | const VIEW = 'foundation::admin.system.information._includes.server-requirements'; |
||
19 | |||
20 | /* ----------------------------------------------------------------- |
||
21 | | Main Methods |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | |||
25 | /** |
||
26 | * Compose the view. |
||
27 | * |
||
28 | * @param \Illuminate\View\View $view |
||
29 | */ |
||
30 | public function compose(View $view) |
||
31 | { |
||
32 | $requirements['server']['ssl'] = $this->checkSslInstalled(); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
33 | $requirements['server']['modules'] = $this->getServerModules([ |
||
34 | 'mod_rewrite', |
||
35 | ]); |
||
36 | |||
37 | $view->with('requirements', $requirements); |
||
38 | } |
||
39 | |||
40 | /* ----------------------------------------------------------------- |
||
41 | | Other Methods |
||
42 | | ----------------------------------------------------------------- |
||
43 | */ |
||
44 | |||
45 | /** |
||
46 | * Check if SSL is installed. |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | private function checkSslInstalled() |
||
51 | { |
||
52 | return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? true : false; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Check the APACHE requirements. |
||
57 | * |
||
58 | * @param array $requirements |
||
59 | * |
||
60 | * @return \Illuminate\Support\Collection |
||
61 | */ |
||
62 | private function getServerModules(array $requirements) |
||
63 | { |
||
64 | if ( ! function_exists('apache_get_modules')) { |
||
65 | return collect([]); |
||
66 | } |
||
67 | |||
68 | $modules = apache_get_modules(); |
||
69 | $requirements = array_combine($requirements, $requirements); |
||
70 | |||
71 | return collect($requirements)->transform(function ($requirement) use ($modules) { |
||
72 | return in_array($requirement, $modules); |
||
73 | }); |
||
74 | } |
||
75 | } |
||
76 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths