1 | <?php |
||
21 | abstract class File |
||
22 | { |
||
23 | /** |
||
24 | * Path to config file. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $filename; |
||
29 | |||
30 | /** |
||
31 | * Path to config file. |
||
32 | * |
||
33 | * @var array |
||
34 | 13 | */ |
|
35 | protected $adapters; |
||
36 | 13 | ||
37 | 13 | /** |
|
38 | * Returns the phpbu Configuration. |
||
39 | 13 | * |
|
40 | 13 | * @param \phpbu\App\Factory $factory |
|
41 | 13 | * @return \phpbu\App\Configuration |
|
42 | 12 | */ |
|
43 | public function getConfiguration(AppFactory $factory) |
||
57 | |||
58 | /** |
||
59 | * Load all available config adapters. |
||
60 | * |
||
61 | * @param \phpbu\App\Factory $factory |
||
62 | */ |
||
63 | protected function setupAdapters(AppFactory $factory) |
||
69 | |||
70 | /** |
||
71 | * Return a registered adapter. |
||
72 | * |
||
73 | * @param string $name |
||
74 | * @return \phpbu\App\Adapter |
||
75 | * @throws \phpbu\App\Exception |
||
76 | */ |
||
77 | protected function getAdapter($name) |
||
84 | |||
85 | 13 | /** |
|
86 | * Return list of adapter configs. |
||
87 | 13 | * |
|
88 | * @return array |
||
89 | */ |
||
90 | abstract protected function getAdapterConfigs(); |
||
91 | |||
92 | /** |
||
93 | * Set the phpbu application settings. |
||
94 | * |
||
95 | * @param \phpbu\App\Configuration $configuration |
||
96 | */ |
||
97 | 15 | abstract public function setAppSettings(Configuration $configuration); |
|
98 | |||
99 | 15 | /** |
|
100 | 15 | * Set the php settings. |
|
101 | 15 | * Checking for include_path and ini settings. |
|
102 | * |
||
103 | 15 | * @param \phpbu\App\Configuration $configuration |
|
104 | 1 | */ |
|
105 | abstract public function setPhpSettings(Configuration $configuration); |
||
106 | 14 | ||
107 | /** |
||
108 | * Set the log configuration. |
||
109 | * |
||
110 | * @param \phpbu\App\Configuration $configuration |
||
111 | * @throws \phpbu\App\Exception |
||
112 | */ |
||
113 | abstract public function setLoggers(Configuration $configuration); |
||
114 | |||
115 | /** |
||
116 | * Set the backup configurations. |
||
117 | * |
||
118 | * @param \phpbu\App\Configuration $configuration |
||
119 | * @throws \phpbu\App\Exception |
||
120 | */ |
||
121 | abstract public function setBackups(Configuration $configuration); |
||
122 | |||
123 | /** |
||
124 | * Converts a path to an absolute one if necessary. |
||
125 | * |
||
126 | * @param string $path |
||
127 | * @param boolean $useIncludePath |
||
128 | * @return string |
||
129 | */ |
||
130 | protected function toAbsolutePath($path, $useIncludePath = false) |
||
134 | |||
135 | /** |
||
136 | * Return option value. |
||
137 | * Checks if the value should be fetched from an Adapter, if not it just returns the value. |
||
138 | * |
||
139 | * @param string $value |
||
140 | * @return string |
||
141 | */ |
||
142 | protected function getOptionValue($value) |
||
152 | |||
153 | /** |
||
154 | * Load the file. |
||
155 | * |
||
156 | * @param string $filename |
||
157 | * @throws \phpbu\App\Exception |
||
158 | * @return \stdClass |
||
159 | */ |
||
160 | protected function loadFile($filename) |
||
171 | } |
||
172 |