| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function run($request) // phpcs:ignore |
||
| 38 | { |
||
| 39 | $base = Director::baseFolder(); |
||
|
|
|||
| 40 | $go = $request->getVar('go'); |
||
| 41 | $rm = '-exec rm {} \;'; |
||
| 42 | $find = 'find . -regextype posix-extended -regex \'.*__(Fit|Fill|ResizedImage|Scale|Resampled).*\.(jpg|png|JPG|jpeg)\' '; |
||
| 43 | if ($go) { |
||
| 44 | exec($find . ' ' . $rm); |
||
| 45 | exec($find . ' ' . $rm, $output, $retval); |
||
| 46 | } else { |
||
| 47 | exec($find); |
||
| 48 | exec($find, $output, $retval); |
||
| 49 | } |
||
| 50 | |||
| 51 | foreach ($output as $key) { |
||
| 52 | DB::alteration_message($key); |
||
| 53 | } |
||
| 54 | |||
| 55 | echo "Returned with status {$retval}"; |
||
| 56 | } |
||
| 58 |