| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | public function run($request) |
||
| 6 | { |
||
| 7 | $iterator = new RegexIterator( |
||
| 8 | new RecursiveIteratorIterator( |
||
| 9 | new RecursiveDirectoryIterator(ASSETS_PATH) |
||
| 10 | ), |
||
| 11 | '/^.+\.delay\.tmp$/i', |
||
| 12 | RecursiveRegexIterator::GET_MATCH |
||
| 13 | ); |
||
| 14 | |||
| 15 | foreach ($iterator as $value) { |
||
| 16 | $inFile = $value[0]; |
||
| 17 | $outFile = str_replace('.delay.tmp', '', $inFile); |
||
| 18 | |||
| 19 | echo "Renaming $inFile to $outFile...<br>\n"; |
||
| 20 | if (!rename($inFile, $outFile)) { |
||
| 21 | throw new \LogicException("Couldn't rename $inFile to $outFile"); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | } |
||
| 26 | } |
||
| 27 |