|
@@ 88-98 (lines=11) @@
|
| 85 |
|
* @param \phpbu\App\Backup\Collector $collector |
| 86 |
|
* @throws \Exception |
| 87 |
|
*/ |
| 88 |
|
protected function simulateChecks(Configuration\Backup $backup, Target $target, Collector $collector) |
| 89 |
|
{ |
| 90 |
|
foreach ($backup->getChecks() as $config) { |
| 91 |
|
$this->result->checkStart($config); |
| 92 |
|
$check = $this->factory->createCheck($config->type); |
| 93 |
|
if ($check instanceof Backup\Check\Simulator) { |
| 94 |
|
$check->simulate($target, $config->value, $collector, $this->result); |
| 95 |
|
} |
| 96 |
|
$this->result->checkEnd($config); |
| 97 |
|
} |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
/** |
| 101 |
|
* Simulate encryption. |
|
@@ 107-118 (lines=12) @@
|
| 104 |
|
* @param \phpbu\App\Backup\Target $target |
| 105 |
|
* @throws \phpbu\App\Exception |
| 106 |
|
*/ |
| 107 |
|
protected function simulateCrypt(Configuration\Backup $backup, Target $target) |
| 108 |
|
{ |
| 109 |
|
if ($backup->hasCrypt()) { |
| 110 |
|
$crypt = $backup->getCrypt(); |
| 111 |
|
$this->result->cryptStart($crypt); |
| 112 |
|
$crypter = $this->factory->createCrypter($crypt->type, $crypt->options); |
| 113 |
|
if ($crypter instanceof Backup\Crypter\Simulator) { |
| 114 |
|
$crypter->simulate($target, $this->result); |
| 115 |
|
} |
| 116 |
|
$this->result->cryptEnd($crypt); |
| 117 |
|
} |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
/** |
| 121 |
|
* Simulate all syncs. |
|
@@ 146-158 (lines=13) @@
|
| 143 |
|
* @param \phpbu\App\Backup\Collector $collector |
| 144 |
|
* @throws \phpbu\App\Exception |
| 145 |
|
*/ |
| 146 |
|
protected function simulateCleanup(Configuration\Backup $backup, Target $target, Collector $collector) |
| 147 |
|
{ |
| 148 |
|
/* @var \phpbu\App\Configuration\Backup\Cleanup $cleanup */ |
| 149 |
|
if ($backup->hasCleanup()) { |
| 150 |
|
$cleanup = $backup->getCleanup(); |
| 151 |
|
$cleaner = $this->factory->createCleaner($cleanup->type, $cleanup->options); |
| 152 |
|
$this->result->cleanupStart($cleanup); |
| 153 |
|
if ($cleaner instanceof Backup\Cleaner\Simulator) { |
| 154 |
|
$cleaner->simulate($target, $collector, $this->result); |
| 155 |
|
} |
| 156 |
|
$this->result->cleanupEnd($cleanup); |
| 157 |
|
} |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
/** |
| 161 |
|
* Execute the compressor. |