| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function run() |
||
| 16 | { |
||
| 17 | global $opt; |
||
| 18 | |||
| 19 | $files = glob($opt['okapi']['var_dir'] . '/garmin*.zip'); |
||
| 20 | foreach ($files as $file) { |
||
| 21 | // delete old download files after 24 hours; this large interval filters out any |
||
| 22 | // timezone mismatches in file systems (e.g. on unconventional development |
||
| 23 | // environments) |
||
| 24 | if (is_file($file) && (time() - filemtime($file)) > 24 * 3600) { |
||
| 25 | unlink($file); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.