1
<?php
2
/**
3
 * Class for getting values from .ini files
4
 *
5
 * PHP Version 5
6
 *
7
 * @category Tasks
8
 * @package  phing.tasks.ext
9
 * @author   Ken Guest <kguest@php.net>
10
 * @license  LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
11
 * @link     http://www.phing.info/
12
 */
13

14

15
/**
16
 * InifileGet
17
 *
18
 * @category Tasks
19
 * @package  phing.tasks.ext
20
 * @author   Ken Guest <ken@linux.ie>
21
 * @license  LGPL (see http://www.gnu.org/licenses/lgpl.html)
22
 * @link     InifileGet.php
23
 */
24
class IniFileGet
25
{
26
    /**
27
     * Default
28
     *
29
     * @var string
30
     */
31
    protected $default = '';
32

33
    /**
34
     * Property
35
     *
36
     * @var string
37
     */
38
    protected $property = null;
39

40
    /**
41
     * Section
42
     *
43
     * @var string
44
     */
45
    protected $section = null;
46

47
    /**
48
     * Output property name
49
     *
50
     * @var string
51
     */
52
    protected $output = null;
53

54

55
    /**
56
     * Set the default value, for if key or section is not present in .ini file
57
     *
58
     * @param string $default Default value
59
     *
60
     * @return void
61
     */
62 1
    public function setDefault($default)
63
    {
64 1
        $this->default = trim($default);
65
    }
66

67
    /**
68
     * Get the default value, for if key or section is not present in .ini file
69
     *
70
     * @return string
71
     */
72 1
    public function getDefault()
73
    {
74 1
        return $this->default;
75
    }
76

77
    /**
78
     * Set Section name
79
     *
80
     * @param string $section Name of section in ini file
81
     *
82
     * @return void
83
     */
84 1
    public function setSection($section)
85
    {
86 1
        $this->section = trim($section);
87
    }
88

89
    /**
90
     * Get Section
91
     *
92
     * @return string
93
     */
94 1
    public function getSection()
95
    {
96 1
        return $this->section;
97
    }
98

99
    /**
100
     * Set Property
101
     *
102
     * @param string $property property/key name
103
     *
104
     * @return void
105
     */
106 1
    public function setProperty($property)
107
    {
108 1
        $this->property = $property;
109
    }
110

111
    /**
112
     * Get Property
113
     *
114
     * @return string
115
     */
116 1
    public function getProperty()
117
    {
118 1
        return $this->property;
119
    }
120

121
    /**
122
     * Set name of property to set retrieved value to
123
     *
124
     * @param string $output Name of property to set with retrieved value
125
     *
126
     * @return void
127
     */
128 1
    public function setOutputProperty($output)
129
    {
130 1
        $this->output = $output;
131
    }
132

133
    /**
134
     * Get name of property to set retrieved value to
135
     *
136
     * @return string
137
     */
138 1
    public function getOutputProperty()
139
    {
140 1
        return $this->output;
141
    }
142
}

Read our documentation on viewing source code .

Loading