| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function download(HTTPRequest $request) |
||
|
|
|||
| 22 | { |
||
| 23 | if(! Permission::check('ADMIN')) { |
||
| 24 | return Security::permissionFailure($this); |
||
| 25 | } |
||
| 26 | $fileName = $this->request->param('ID').'.csv'; |
||
| 27 | $hiddenDownloadDir = Config::inst()->get(ArrayToCSV::class, 'hidden_download_dir') ?: '_csv_download_dir'; |
||
| 28 | $path = Controller::join_links(Director::baseFolder(), $hiddenDownloadDir, $fileName); |
||
| 29 | return HTTPRequest::send_file(file_get_contents($path), $fileName, 'text/csv'); |
||
| 30 | } |
||
| 32 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.