summaryrefslogtreecommitdiff
path: root/tests/BaseTestCase.php
diff options
context:
space:
mode:
authorRobert Bruce Park <r@robru.ca>2013-11-14 19:31:22 -0800
committerRobert Bruce Park <r@robru.ca>2013-11-14 19:31:22 -0800
commit12deac25d69b63523507855218d3279ce29ab6eb (patch)
tree4030edd47562c025c25f9fd134fe46a0e849ebb5 /tests/BaseTestCase.php
parent855c77a83f1db1da041b1d14bb114378bed64855 (diff)
Correctly handle most recent backup if it's older than 24hs.
Code was assuming that you'd run backups hourly, eg, so you'd have many backups within the last 24 hours. Code assumed that by the time you found a backup more than 24h old, you'd already have a value for $prev set. In the event that your most recent backup is more than 24 hours old, $prev would not be set and bash would get an error "unary operator expected" when it tried to compare the day of the newest backup to the empty $prev value. I fix this by setting a default value for $prev, one that cannot be mistaken for an existing backup because it does not represent a valid date. This ensures that the most recent backup is correctly preserved regardless of it's age.
Diffstat (limited to 'tests/BaseTestCase.php')
0 files changed, 0 insertions, 0 deletions