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
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class Profile |
24
|
|
|
* |
25
|
|
|
* Backup profile. |
26
|
|
|
* |
27
|
|
|
* @package RunOpenCode\Backup\Backup |
28
|
|
|
*/ |
29
|
|
|
final class Profile implements ProfileInterface |
30
|
|
|
{ |
31
|
|
|
/** |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
private $name; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var SourceInterface |
38
|
|
|
*/ |
39
|
|
|
private $source; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var ProcessorInterface |
43
|
|
|
*/ |
44
|
|
|
private $processor; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var NamerInterface |
48
|
|
|
*/ |
49
|
|
|
private $namer; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var RotatorInterface |
53
|
|
|
*/ |
54
|
|
|
private $preRotator; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var DestinationInterface |
58
|
|
|
*/ |
59
|
|
|
private $destination; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var RotatorInterface |
63
|
|
|
*/ |
64
|
|
|
private $postRotator; |
65
|
|
|
|
66
|
28 |
|
public function __construct( |
67
|
|
|
$name, |
68
|
|
|
SourceInterface $source, |
69
|
|
|
ProcessorInterface $processor, |
70
|
|
|
NamerInterface $namer, |
71
|
|
|
RotatorInterface $preRotator, |
72
|
|
|
DestinationInterface $destination, |
73
|
|
|
RotatorInterface $postRotator |
74
|
|
|
) { |
75
|
28 |
|
$this->name = $name; |
76
|
28 |
|
$this->source = $source; |
77
|
28 |
|
$this->processor = $processor; |
78
|
28 |
|
$this->namer = $namer; |
79
|
28 |
|
$this->preRotator = $preRotator; |
80
|
28 |
|
$this->destination = $destination; |
81
|
28 |
|
$this->postRotator = $postRotator; |
82
|
28 |
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* {@inheritdoc} |
86
|
|
|
*/ |
87
|
14 |
|
public function getName() |
88
|
|
|
{ |
89
|
14 |
|
return $this->name; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* {@inheritdoc} |
94
|
|
|
*/ |
95
|
10 |
|
public function getSource() |
96
|
|
|
{ |
97
|
10 |
|
return $this->source; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* {@inheritdoc} |
102
|
|
|
*/ |
103
|
8 |
|
public function getProcessor() |
104
|
|
|
{ |
105
|
8 |
|
return $this->processor; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* {@inheritdoc} |
110
|
|
|
*/ |
111
|
6 |
|
public function getNamer() |
112
|
|
|
{ |
113
|
6 |
|
return $this->namer; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* {@inheritdoc} |
118
|
|
|
*/ |
119
|
8 |
|
public function getPreRotator() |
120
|
|
|
{ |
121
|
8 |
|
return $this->preRotator; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* {@inheritdoc} |
126
|
|
|
*/ |
127
|
16 |
|
public function getDestination() |
128
|
|
|
{ |
129
|
16 |
|
return $this->destination; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* {@inheritdoc} |
134
|
|
|
*/ |
135
|
8 |
|
public function getPostRotator() |
136
|
|
|
{ |
137
|
8 |
|
return $this->postRotator; |
138
|
|
|
} |
139
|
|
|
} |
140
|
|
|
|