| @@ 289-295 (lines=7) @@ | ||
| 286 | if ($i == $max) { |
|
| 287 | //delete the top one ... |
|
| 288 | clearstatcache(); |
|
| 289 | if (file_exists($lowerFileLocation)) { |
|
| 290 | clearstatcache(); |
|
| 291 | $obj = DatabasebackupLog::get()->filter(array("FullLocation" => $lowerFileLocation))->First(); |
|
| 292 | if ($obj) { |
|
| 293 | $obj->delete(); |
|
| 294 | } |
|
| 295 | } |
|
| 296 | } else { |
|
| 297 | $j = $i + 1; |
|
| 298 | $higherFileLocation = $fileLocation.".".$j.".bak"; |
|
| @@ 302-308 (lines=7) @@ | ||
| 299 | clearstatcache(); |
|
| 300 | if (file_exists($lowerFileLocation)) { |
|
| 301 | //double-check the top one ... |
|
| 302 | if (file_exists($higherFileLocation)) { |
|
| 303 | clearstatcache(); |
|
| 304 | $obj = DatabasebackupLog::get()->filter(array("FullLocation" => $higherFileLocation))->First(); |
|
| 305 | if ($obj) { |
|
| 306 | $obj->delete(); |
|
| 307 | } |
|
| 308 | } |
|
| 309 | clearstatcache(); |
|
| 310 | if (rename($lowerFileLocation, $higherFileLocation)) { |
|
| 311 | $obj = DatabasebackupLog::get()->filter(array("FullLocation" => $lowerFileLocation))->First(); |
|
| @@ 330-335 (lines=6) @@ | ||
| 327 | if (file_exists($lowerFileLocation)) { |
|
| 328 | unlink($lowerFileLocation); |
|
| 329 | clearstatcache(); |
|
| 330 | if (!file_exists($lowerFileLocation)) { |
|
| 331 | $obj = DatabasebackupLog::get()->filter(array("FullLocation" => $lowerFileLocation))->First(); |
|
| 332 | if ($obj) { |
|
| 333 | $obj->delete(); |
|
| 334 | } |
|
| 335 | } |
|
| 336 | } |
|
| 337 | clearstatcache(); |
|
| 338 | if (rename($fileLocation, $lowerFileLocation)) { |
|