|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* AppserverIo\Properties\Filter\PropertyStreamFilter |
|
5
|
|
|
* |
|
6
|
|
|
* NOTICE OF LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
|
9
|
|
|
* that is available through the world-wide-web at this URL: |
|
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
|
11
|
|
|
* |
|
12
|
|
|
* PHP version 5 |
|
13
|
|
|
* |
|
14
|
|
|
* @author Tim Wagner <[email protected]> |
|
15
|
|
|
* @author Bernhard Wick <[email protected]> |
|
16
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
|
17
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
18
|
|
|
* @link http://github.com/appserver-io/properties |
|
19
|
|
|
* @link http://www.appserver.io |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace AppserverIo\Properties\Filter; |
|
23
|
|
|
|
|
24
|
|
|
use AppserverIo\Properties\PropertiesInterface; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* The params to initialize the property stream filter. |
|
28
|
|
|
* |
|
29
|
|
|
* @author Tim Wagner <[email protected]> |
|
30
|
|
|
* @author Bernhard Wick <[email protected]> |
|
31
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
|
32
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
33
|
|
|
* @link http://github.com/appserver-io/properties |
|
34
|
|
|
* @link http://www.appserver.io |
|
35
|
|
|
*/ |
|
36
|
|
|
class PropertyStreamFilterParams |
|
37
|
|
|
{ |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* The default pattern the variables are declared with. |
|
41
|
|
|
* |
|
42
|
|
|
* @var string |
|
43
|
|
|
*/ |
|
44
|
|
|
const PATTERN = '${%s}'; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* The pattern that declares the variables to be replaced. |
|
48
|
|
|
* |
|
49
|
|
|
* @var string |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $pattern; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* The properties used for replacing the variables. |
|
55
|
|
|
* |
|
56
|
|
|
* @var \AppserverIo\Properties\PropertiesInterface |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $properties; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Initializes the params with the passed values. |
|
62
|
|
|
* |
|
63
|
|
|
* @param \AppserverIo\Properties\PropertiesInterface $properties The properties used for replacement |
|
64
|
|
|
* @param string $pattern The pattern that declares the variables to be replaced |
|
65
|
|
|
*/ |
|
66
|
2 |
|
public function __construct(PropertiesInterface $properties, $pattern = PropertyStreamFilterParams::PATTERN) |
|
67
|
|
|
{ |
|
68
|
2 |
|
$this->properties = $properties; |
|
69
|
2 |
|
$this->pattern = $pattern; |
|
70
|
2 |
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Return's the properties use for replacement. |
|
74
|
|
|
* |
|
75
|
|
|
* @return \AppserverIo\Properties\PropertiesInterface The properties |
|
76
|
|
|
*/ |
|
77
|
2 |
|
public function getProperties() |
|
78
|
|
|
{ |
|
79
|
2 |
|
return $this->properties; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* Return's the pattern that declares the variables to be replaced. |
|
84
|
|
|
* |
|
85
|
|
|
* @return string The pattern |
|
86
|
|
|
*/ |
|
87
|
2 |
|
public function getPattern() |
|
88
|
|
|
{ |
|
89
|
2 |
|
return $this->pattern; |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
|