1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the Backup package, an RunOpenCode project. |
4
|
|
|
* |
5
|
|
|
* (c) 2015 RunOpenCode |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* This project is fork of "kbond/php-backup", for full credits info, please |
11
|
|
|
* view CREDITS file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
namespace RunOpenCode\Backup\Backup; |
14
|
|
|
|
15
|
|
|
use RunOpenCode\Backup\Contract\DestinationInterface; |
16
|
|
|
use RunOpenCode\Backup\Contract\NamerInterface; |
17
|
|
|
use RunOpenCode\Backup\Contract\ProcessorInterface; |
18
|
|
|
use RunOpenCode\Backup\Contract\ProfileInterface; |
19
|
|
|
use RunOpenCode\Backup\Contract\RotatorInterface; |
20
|
|
|
use RunOpenCode\Backup\Contract\SourceInterface; |
21
|
|
|
use RunOpenCode\Backup\Contract\WorkflowInterface; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Class Profile |
25
|
|
|
* |
26
|
|
|
* Backup profile. |
27
|
|
|
* |
28
|
|
|
* @package RunOpenCode\Backup\Backup |
29
|
|
|
*/ |
30
|
|
|
final class Profile implements ProfileInterface |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
private $name; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var SourceInterface |
39
|
|
|
*/ |
40
|
|
|
private $source; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var ProcessorInterface |
44
|
|
|
*/ |
45
|
|
|
private $processor; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var NamerInterface |
49
|
|
|
*/ |
50
|
|
|
private $namer; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var RotatorInterface |
54
|
|
|
*/ |
55
|
|
|
private $preRotator; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var DestinationInterface |
59
|
|
|
*/ |
60
|
|
|
private $destination; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var RotatorInterface |
64
|
|
|
*/ |
65
|
|
|
private $postRotator; |
66
|
|
|
|
67
|
26 |
|
public function __construct( |
68
|
|
|
$name, |
69
|
|
|
SourceInterface $source, |
70
|
|
|
ProcessorInterface $processor, |
71
|
|
|
NamerInterface $namer, |
72
|
|
|
RotatorInterface $preRotator, |
73
|
|
|
DestinationInterface $destination, |
74
|
|
|
RotatorInterface $postRotator |
75
|
|
|
) { |
76
|
26 |
|
$this->name = $name; |
77
|
26 |
|
$this->source = $source; |
78
|
26 |
|
$this->processor = $processor; |
79
|
26 |
|
$this->namer = $namer; |
80
|
26 |
|
$this->preRotator = $preRotator; |
81
|
26 |
|
$this->destination = $destination; |
82
|
26 |
|
$this->postRotator = $postRotator; |
83
|
26 |
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* {@inheritdoc} |
87
|
|
|
*/ |
88
|
12 |
|
public function getName() |
89
|
|
|
{ |
90
|
12 |
|
return $this->name; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* {@inheritdoc} |
95
|
|
|
*/ |
96
|
8 |
|
public function getSource() |
97
|
|
|
{ |
98
|
8 |
|
return $this->source; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* {@inheritdoc} |
103
|
|
|
*/ |
104
|
4 |
|
public function getProcessor() |
105
|
|
|
{ |
106
|
4 |
|
return $this->processor; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* {@inheritdoc} |
111
|
|
|
*/ |
112
|
2 |
|
public function getNamer() |
113
|
|
|
{ |
114
|
2 |
|
return $this->namer; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* {@inheritdoc} |
119
|
|
|
*/ |
120
|
4 |
|
public function getPreRotator() |
121
|
|
|
{ |
122
|
4 |
|
return $this->preRotator; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* {@inheritdoc} |
127
|
|
|
*/ |
128
|
12 |
|
public function getDestination() |
129
|
|
|
{ |
130
|
12 |
|
return $this->destination; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* {@inheritdoc} |
135
|
|
|
*/ |
136
|
4 |
|
public function getPostRotator() |
137
|
|
|
{ |
138
|
4 |
|
return $this->postRotator; |
139
|
|
|
} |
140
|
|
|
} |
141
|
|
|
|