Skip to content

Commit ba538e7

Browse files
Fix target timing issue #156
In cases where sources create a directory and phpbu has to compress the directory with tar first phpbu will add a '.tar' suffix to the target. The regex to collect all backups for cleanup was created before all suffixes where set correctly. This resulted in not working cleanups. The issue is fixed by creating the regex right before all backups are collected.
1 parent 71e2065 commit ba538e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Backup/Collector/Local.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class Local extends Abstraction implements Collector
2828
*/
2929
public function __construct(Target $target)
3030
{
31-
$this->target = $target;
32-
$this->fileRegex = Util\Path::datePlaceholdersToRegex($this->target->getFilenameRaw());
31+
$this->target = $target;
3332
}
3433

3534
/**
3635
* Collect all created backups.
3736
*/
3837
protected function collectBackups()
3938
{
39+
$this->fileRegex = Util\Path::datePlaceholdersToRegex($this->target->getFilenameRaw());
4040
$this->collect($this->target->getPath()->getPathThatIsNotChanging());
4141
}
4242

0 commit comments

Comments
 (0)