@@ 15-54 (lines=40) @@ | ||
12 | /** |
|
13 | * @author Kevin Bond <[email protected]> |
|
14 | */ |
|
15 | class GzipArchiveProcessorFactory implements Factory |
|
16 | { |
|
17 | /** |
|
18 | * {@inheritdoc} |
|
19 | */ |
|
20 | public function getName() |
|
21 | { |
|
22 | return 'gzip'; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | */ |
|
28 | public function create(ContainerBuilder $container, $id, array $config) |
|
29 | { |
|
30 | $serviceId = sprintf('zenstruck_backup.processor.%s', $id); |
|
31 | ||
32 | $container->setDefinition($serviceId, new DefinitionDecorator('zenstruck_backup.processor.abstract_gzip')) |
|
33 | ->replaceArgument(0, $id) |
|
34 | ->replaceArgument(1, $config['options']) |
|
35 | ->replaceArgument(2, $config['timeout']) |
|
36 | ->addTag('zenstruck_backup.processor') |
|
37 | ; |
|
38 | ||
39 | return new Reference($serviceId); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * {@inheritdoc} |
|
44 | */ |
|
45 | public function addConfiguration(ArrayNodeDefinition $builder) |
|
46 | { |
|
47 | $builder |
|
48 | ->children() |
|
49 | ->scalarNode('options')->defaultValue(GzipArchiveProcessor::DEFAULT_OPTIONS)->end() |
|
50 | ->integerNode('timeout')->defaultValue(GzipArchiveProcessor::DEFAULT_TIMEOUT)->end() |
|
51 | ->end() |
|
52 | ; |
|
53 | } |
|
54 | } |
|
55 |
@@ 15-54 (lines=40) @@ | ||
12 | /** |
|
13 | * @author Kevin Bond <[email protected]> |
|
14 | */ |
|
15 | class ZipArchiveProcessorFactory implements Factory |
|
16 | { |
|
17 | /** |
|
18 | * {@inheritdoc} |
|
19 | */ |
|
20 | public function getName() |
|
21 | { |
|
22 | return 'zip'; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * {@inheritdoc} |
|
27 | */ |
|
28 | public function create(ContainerBuilder $container, $id, array $config) |
|
29 | { |
|
30 | $serviceId = sprintf('zenstruck_backup.processor.%s', $id); |
|
31 | ||
32 | $container->setDefinition($serviceId, new DefinitionDecorator('zenstruck_backup.processor.abstract_zip')) |
|
33 | ->replaceArgument(0, $id) |
|
34 | ->replaceArgument(1, $config['options']) |
|
35 | ->replaceArgument(2, $config['timeout']) |
|
36 | ->addTag('zenstruck_backup.processor') |
|
37 | ; |
|
38 | ||
39 | return new Reference($serviceId); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * {@inheritdoc} |
|
44 | */ |
|
45 | public function addConfiguration(ArrayNodeDefinition $builder) |
|
46 | { |
|
47 | $builder |
|
48 | ->children() |
|
49 | ->scalarNode('options')->defaultValue(ZipArchiveProcessor::DEFAULT_OPTIONS)->end() |
|
50 | ->integerNode('timeout')->defaultValue(ZipArchiveProcessor::DEFAULT_TIMEOUT)->end() |
|
51 | ->end() |
|
52 | ; |
|
53 | } |
|
54 | } |
|
55 |