| Conditions | 5 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function run($request) |
||
| 19 | { |
||
| 20 | $this->request = $request; |
||
| 21 | |||
| 22 | $folder = Director::baseFolder() . '/silverstripe-cache'; |
||
| 23 | $create = $_GET['create'] ?? false; |
||
| 24 | if (!is_dir($folder)) { |
||
| 25 | if ($create) { |
||
| 26 | mkdir($folder, 0755); |
||
| 27 | } else { |
||
| 28 | throw new Exception("silverstripe-cache folder does not exist in root"); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | $result = FileHelper::rmDir($folder); |
||
| 33 | if ($result) { |
||
| 34 | $this->message("Removed $folder"); |
||
| 35 | } else { |
||
| 36 | $this->message("Failed to remove $folder", "error"); |
||
| 37 | } |
||
| 38 | $result = mkdir($folder, 0755); |
||
| 39 | if ($result) { |
||
| 40 | $this->message("A new folder has been created at $folder"); |
||
| 41 | } else { |
||
| 42 | $this->message("Failed to create a new folder at $folder", "error"); |
||
| 43 | } |
||
| 46 |
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