1 | <?php |
||
32 | class MageReport extends AbstractCheck |
||
33 | { |
||
34 | const RESULT_SUCCESS = 'ok'; |
||
35 | const RESULT_FAIL = 'fail'; |
||
36 | const BASE_URL = 'https://www.magereport.com/'; |
||
37 | |||
38 | /** |
||
39 | * The URL we're scanning |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $url; |
||
44 | |||
45 | /** |
||
46 | * List of patches to check for |
||
47 | * |
||
48 | * @param array $patches |
||
49 | */ |
||
50 | public $patches = [ |
||
51 | 'scan/result/supee5344', |
||
52 | 'scan/result/supee5994', |
||
53 | 'scan/result/supee6285', |
||
54 | 'scan/result/supee6482', |
||
55 | 'scan/result/supee6788', |
||
56 | 'scan/result/supee7405', |
||
57 | 'scan/result/supee8788', |
||
58 | ]; |
||
59 | |||
60 | /** |
||
61 | * Set the URL |
||
62 | * |
||
63 | * @param string $url |
||
64 | */ |
||
65 | public function __construct($url) |
||
69 | |||
70 | /** |
||
71 | * Check all patches |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | public function checkAll() |
||
89 | |||
90 | /** |
||
91 | * Check if a given patch is installed |
||
92 | * |
||
93 | * @param string $endpoint |
||
94 | * |
||
95 | * @return integer |
||
96 | */ |
||
97 | public function check($endpoint) |
||
103 | |||
104 | /** |
||
105 | * Get patch name from path |
||
106 | * |
||
107 | * @param string $path |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | protected function getPatchName($path) |
||
116 | |||
117 | /** |
||
118 | * Derive if patched or not based on the response |
||
119 | * |
||
120 | * @param Response $response |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | protected function parseResponse(Response $response) |
||
137 | } |
||
138 |