Skip to content

Commit 23fae06

Browse files
Merge branch 'master' into 5.1
2 parents 8226e75 + a51f455 commit 23fae06

File tree

14 files changed

+85
-5
lines changed

14 files changed

+85
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 7.0
55
- 7.1
66
- 7.2
7+
- 7.3
78

89
before_script:
910
- composer self-update

doc/config/log/mail.smtp.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<!-- mandatory -->
1919
<option name="transport" value="smtp" />
2020

21-
<!-- optional default=587 -->
21+
<!-- optional default=25 -->
2222
<option name="smtp.port" value="587" />
2323

2424
<!-- mandatory -->

doc/config/source/tar.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"compressProgram": "lbzip2",
88
"removeSourceDir": false,
99
"throttle": "5m",
10-
"pathToTar": "/path/to/custom/bin"
10+
"pathToTar": "/path/to/custom/bin",
11+
"dereference": false
1112
}
1213
}

doc/config/source/tar.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@
2323

2424
<!-- define your custom tar executable location -->
2525
<option name="pathToTar" value="/path/to/custom/bin" />
26+
27+
<!-- optional, default false -->
28+
<option name="dereference" value="false" />
2629
</source>

src/Backup/Source/Tar.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ class Tar extends SimulatorExecutable implements Simulator
104104
*/
105105
private $pathToArchive;
106106

107+
/**
108+
* Instead of archiving symbolic links, archive the files they link to
109+
*
110+
* @var bool
111+
*/
112+
private $dereference;
113+
107114
/**
108115
* Setup.
109116
*
@@ -121,6 +128,7 @@ public function setup(array $conf = [])
121128
$this->forceLocal = Util\Str::toBoolean(Util\Arr::getValue($conf, 'forceLocal', ''), false);
122129
$this->ignoreFailedRead = Util\Str::toBoolean(Util\Arr::getValue($conf, 'ignoreFailedRead', ''), false);
123130
$this->removeSourceDir = Util\Str::toBoolean(Util\Arr::getValue($conf, 'removeSourceDir', ''), false);
131+
$this->dereference = Util\Str::toBoolean(Util\Arr::getValue($conf, 'dereference', ''), false);
124132
}
125133

126134
/**
@@ -192,7 +200,8 @@ protected function createExecutable(Target $target) : Executable
192200
->ignoreFailedRead($this->ignoreFailedRead)
193201
->removeSourceDirectory($this->removeSourceDir)
194202
->throttle($this->throttle)
195-
->archiveTo($this->pathToArchive);
203+
->archiveTo($this->pathToArchive)
204+
->dereference($this->dereference);
196205
// add paths to exclude
197206
foreach ($this->excludes as $path) {
198207
$executable->addExclude($path);

src/Cli/Executable/Tar.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ class Tar extends Abstraction implements Executable
9898
'xz' => 'J'
9999
];
100100

101+
/**
102+
* Instead of archiving symbolic links, archive the files they link to
103+
*
104+
* @var bool
105+
*/
106+
private $dereference = false;
107+
101108
/**
102109
* Constructor.
103110
*
@@ -241,6 +248,18 @@ public function removeSourceDirectory(bool $bool) : Tar
241248
return $this;
242249
}
243250

251+
/**
252+
* Instead of archiving symbolic links, archive the files they link
253+
*
254+
* @param bool $bool
255+
* @return \phpbu\App\Cli\Executable\Tar
256+
*/
257+
public function dereference(bool $bool) : Tar
258+
{
259+
$this->dereference = $bool;
260+
return $this;
261+
}
262+
244263
/**
245264
* Tar CommandLine generator.
246265
*
@@ -259,6 +278,7 @@ protected function createCommandLine() : CommandLine
259278
$this->setExcludeOptions($tar);
260279
$this->handleWarnings($tar);
261280

281+
$tar->addOptionIfNotEmpty('-h', $this->dereference, false);
262282
$tar->addOptionIfNotEmpty('--force-local', $this->local, false);
263283
$tar->addOptionIfNotEmpty('--use-compress-program', $this->compressProgram);
264284
$tar->addOption('-' . (empty($this->compressProgram) ? $this->compression : '') . $create);

src/Cmd/Args.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
1414
* @link http://phpbu.de/
1515
* @since Class available since Release 1.0.0
16+
* @internal
1617
*/
17-
class Args
18+
final class Args
1819
{
1920

2021
/**

src/Runner/Backup.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
2121
* @link https://phpbu.de/
2222
* @since Class available since Release 5.1.0
23+
* @internal
2324
*/
2425
class Backup extends Compression
2526
{

src/Runner/Compression.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
1616
* @link https://phpbu.de/
1717
* @since Class available since Release 5.1.0
18+
* @internal
1819
*/
1920
abstract class Compression extends Process
2021
{

src/Runner/Process.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
1616
* @link https://phpbu.de/
1717
* @since Class available since Release 5.1.0
18+
* @internal
1819
*/
1920
abstract class Process
2021
{

0 commit comments

Comments
 (0)