Subversion Repositories ALCASAR

Rev

Rev 2976 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2976 Rev 3037
Line 26... Line 26...
26
class DiskDevice
26
class DiskDevice
27
{
27
{
28
    /**
28
    /**
29
     * name of the disk device
29
     * name of the disk device
30
     *
30
     *
31
     * @var String
31
     * @var string
32
     */
32
     */
33
    private $_name = "";
33
    private $_name = "";
34
 
34
 
35
    /**
35
    /**
36
     * type of the filesystem on the disk device
36
     * type of the filesystem on the disk device
37
     *
37
     *
38
     * @var String
38
     * @var string
39
     */
39
     */
40
    private $_fsType = "";
40
    private $_fsType = "";
41
 
41
 
42
    /**
42
    /**
43
     * diskspace that is free in bytes
43
     * diskspace that is free in bytes
44
     *
44
     *
45
     * @var Integer
45
     * @var int
46
     */
46
     */
47
    private $_free = 0;
47
    private $_free = 0;
48
 
48
 
49
    /**
49
    /**
50
     * diskspace that is used in bytes
50
     * diskspace that is used in bytes
51
     *
51
     *
52
     * @var Integer
52
     * @var int
53
     */
53
     */
54
    private $_used = 0;
54
    private $_used = 0;
55
 
55
 
56
    /**
56
    /**
57
     * total diskspace
57
     * total diskspace
58
     *
58
     *
59
     * @var Integer
59
     * @var int
60
     */
60
     */
61
    private $_total = 0;
61
    private $_total = 0;
62
 
62
 
63
    /**
63
    /**
64
     * mount point of the disk device if available
64
     * mount point of the disk device if available
65
     *
65
     *
66
     * @var String
66
     * @var string
67
     */
67
     */
68
    private $_mountPoint = null;
68
    private $_mountPoint = null;
69
 
69
 
70
    /**
70
    /**
71
     * additional options of the device, like mount options
71
     * additional options of the device, like mount options
72
     *
72
     *
73
     * @var String
73
     * @var string
74
     */
74
     */
75
    private $_options = null;
75
    private $_options = null;
76
 
76
 
77
    /**
77
    /**
78
     * inodes usage in percent if available
78
     * inodes usage in percent if available
79
     *
79
     *
80
     * @var Integer
80
     * @var int
81
     */
81
     */
82
    private $_percentInodesUsed = null;
82
    private $_percentInodesUsed = null;
83
 
83
 
84
    /**
84
    /**
85
     * ignore mode
85
     * ignore mode
86
     *
86
     *
87
     * @var Integer
87
     * @var int
88
     */
88
     */
89
    private $_ignore = 0;
89
    private $_ignore = 0;
90
 
90
 
91
    /**
91
    /**
92
     * Returns PercentUsed calculated when function is called from internal values
92
     * Returns PercentUsed calculated when function is called from internal values
93
     *
93
     *
94
     * @see DiskDevice::$_total
94
     * @see DiskDevice::$_total
95
     * @see DiskDevice::$_used
95
     * @see DiskDevice::$_used
96
     *
96
     *
97
     * @return Integer
97
     * @return int
98
     */
98
     */
99
    public function getPercentUsed()
99
    public function getPercentUsed()
100
    {
100
    {
101
        if ($this->_total > 0) {
101
        if ($this->_total > 0) {
102
            return 100 - min(floor($this->_free / $this->_total * 100), 100);
102
            return 100 - min(floor($this->_free / $this->_total * 100), 100);
Line 108... Line 108...
108
    /**
108
    /**
109
     * Returns $_PercentInodesUsed.
109
     * Returns $_PercentInodesUsed.
110
     *
110
     *
111
     * @see DiskDevice::$_PercentInodesUsed
111
     * @see DiskDevice::$_PercentInodesUsed
112
     *
112
     *
113
     * @return Integer
113
     * @return int
114
     */
114
     */
115
    public function getPercentInodesUsed()
115
    public function getPercentInodesUsed()
116
    {
116
    {
117
        return $this->_percentInodesUsed;
117
        return $this->_percentInodesUsed;
118
    }
118
    }
119
 
119
 
120
    /**
120
    /**
121
     * Sets $_PercentInodesUsed.
121
     * Sets $_PercentInodesUsed.
122
     *
122
     *
123
     * @param Integer $percentInodesUsed inodes percent
123
     * @param int $percentInodesUsed inodes percent
124
     *
124
     *
125
     * @see DiskDevice::$_PercentInodesUsed
125
     * @see DiskDevice::$_PercentInodesUsed
126
     *
126
     *
127
     * @return Void
127
     * @return void
128
     */
128
     */
129
    public function setPercentInodesUsed($percentInodesUsed)
129
    public function setPercentInodesUsed($percentInodesUsed)
130
    {
130
    {
131
        $this->_percentInodesUsed = $percentInodesUsed;
131
        $this->_percentInodesUsed = $percentInodesUsed;
132
    }
132
    }
Line 134... Line 134...
134
    /**
134
    /**
135
     * Returns $_free.
135
     * Returns $_free.
136
     *
136
     *
137
     * @see DiskDevice::$_free
137
     * @see DiskDevice::$_free
138
     *
138
     *
139
     * @return Integer
139
     * @return int
140
     */
140
     */
141
    public function getFree()
141
    public function getFree()
142
    {
142
    {
143
        return $this->_free;
143
        return $this->_free;
144
    }
144
    }
145
 
145
 
146
    /**
146
    /**
147
     * Sets $_free.
147
     * Sets $_free.
148
     *
148
     *
149
     * @param Integer $free free bytes
149
     * @param int $free free bytes
150
     *
150
     *
151
     * @see DiskDevice::$_free
151
     * @see DiskDevice::$_free
152
     *
152
     *
153
     * @return Void
153
     * @return void
154
     */
154
     */
155
    public function setFree($free)
155
    public function setFree($free)
156
    {
156
    {
157
        $this->_free = $free;
157
        $this->_free = $free;
158
    }
158
    }
Line 160... Line 160...
160
    /**
160
    /**
161
     * Returns $_fsType.
161
     * Returns $_fsType.
162
     *
162
     *
163
     * @see DiskDevice::$_fsType
163
     * @see DiskDevice::$_fsType
164
     *
164
     *
165
     * @return String
165
     * @return string
166
     */
166
     */
167
    public function getFsType()
167
    public function getFsType()
168
    {
168
    {
169
        return $this->_fsType;
169
        return $this->_fsType;
170
    }
170
    }
Line 174... Line 174...
174
     *
174
     *
175
     * @param String $fsType filesystemtype
175
     * @param String $fsType filesystemtype
176
     *
176
     *
177
     * @see DiskDevice::$_fsType
177
     * @see DiskDevice::$_fsType
178
     *
178
     *
179
     * @return Void
179
     * @return void
180
     */
180
     */
181
    public function setFsType($fsType)
181
    public function setFsType($fsType)
182
    {
182
    {
183
        $this->_fsType = $fsType;
183
        $this->_fsType = $fsType;
184
    }
184
    }
Line 186... Line 186...
186
    /**
186
    /**
187
     * Returns $_mountPoint.
187
     * Returns $_mountPoint.
188
     *
188
     *
189
     * @see DiskDevice::$_mountPoint
189
     * @see DiskDevice::$_mountPoint
190
     *
190
     *
191
     * @return String
191
     * @return string
192
     */
192
     */
193
    public function getMountPoint()
193
    public function getMountPoint()
194
    {
194
    {
195
        return $this->_mountPoint;
195
        return $this->_mountPoint;
196
    }
196
    }
197
 
197
 
198
    /**
198
    /**
199
     * Sets $_mountPoint.
199
     * Sets $_mountPoint.
200
     *
200
     *
201
     * @param String $mountPoint mountpoint
201
     * @param string $mountPoint mountpoint
202
     *
202
     *
203
     * @see DiskDevice::$_mountPoint
203
     * @see DiskDevice::$_mountPoint
204
     *
204
     *
205
     * @return Void
205
     * @return void
206
     */
206
     */
207
    public function setMountPoint($mountPoint)
207
    public function setMountPoint($mountPoint)
208
    {
208
    {
209
        $this->_mountPoint = $mountPoint;
209
        $this->_mountPoint = $mountPoint;
210
    }
210
    }
Line 212... Line 212...
212
    /**
212
    /**
213
     * Returns $_name.
213
     * Returns $_name.
214
     *
214
     *
215
     * @see DiskDevice::$_name
215
     * @see DiskDevice::$_name
216
     *
216
     *
217
     * @return String
217
     * @return string
218
     */
218
     */
219
    public function getName()
219
    public function getName()
220
    {
220
    {
221
        return $this->_name;
221
        return $this->_name;
222
    }
222
    }
223
 
223
 
224
    /**
224
    /**
225
     * Sets $_name.
225
     * Sets $_name.
226
     *
226
     *
227
     * @param String $name device name
227
     * @param string $name device name
228
     *
228
     *
229
     * @see DiskDevice::$_name
229
     * @see DiskDevice::$_name
230
     *
230
     *
231
     * @return Void
231
     * @return void
232
     */
232
     */
233
    public function setName($name)
233
    public function setName($name)
234
    {
234
    {
235
        $this->_name = $name;
235
        $this->_name = $name;
236
    }
236
    }
Line 238... Line 238...
238
    /**
238
    /**
239
     * Returns $_options.
239
     * Returns $_options.
240
     *
240
     *
241
     * @see DiskDevice::$_options
241
     * @see DiskDevice::$_options
242
     *
242
     *
243
     * @return String
243
     * @return string
244
     */
244
     */
245
    public function getOptions()
245
    public function getOptions()
246
    {
246
    {
247
        return $this->_options;
247
        return $this->_options;
248
    }
248
    }
249
 
249
 
250
    /**
250
    /**
251
     * Sets $_options.
251
     * Sets $_options.
252
     *
252
     *
253
     * @param String $options additional options
253
     * @param string $options additional options
254
     *
254
     *
255
     * @see DiskDevice::$_options
255
     * @see DiskDevice::$_options
256
     *
256
     *
257
     * @return Void
257
     * @return void
258
     */
258
     */
259
    public function setOptions($options)
259
    public function setOptions($options)
260
    {
260
    {
261
        $this->_options = $options;
261
        $this->_options = $options;
262
    }
262
    }
Line 264... Line 264...
264
    /**
264
    /**
265
     * Returns $_total.
265
     * Returns $_total.
266
     *
266
     *
267
     * @see DiskDevice::$_total
267
     * @see DiskDevice::$_total
268
     *
268
     *
269
     * @return Integer
269
     * @return int
270
     */
270
     */
271
    public function getTotal()
271
    public function getTotal()
272
    {
272
    {
273
        return $this->_total;
273
        return $this->_total;
274
    }
274
    }
275
 
275
 
276
    /**
276
    /**
277
     * Sets $_total.
277
     * Sets $_total.
278
     *
278
     *
279
     * @param Integer $total total bytes
279
     * @param int $total total bytes
280
     *
280
     *
281
     * @see DiskDevice::$_total
281
     * @see DiskDevice::$_total
282
     *
282
     *
283
     * @return Void
283
     * @return void
284
     */
284
     */
285
    public function setTotal($total)
285
    public function setTotal($total)
286
    {
286
    {
287
        $this->_total = $total;
287
        $this->_total = $total;
288
    }
288
    }
Line 290... Line 290...
290
    /**
290
    /**
291
     * Returns $_used.
291
     * Returns $_used.
292
     *
292
     *
293
     * @see DiskDevice::$_used
293
     * @see DiskDevice::$_used
294
     *
294
     *
295
     * @return Integer
295
     * @return int
296
     */
296
     */
297
    public function getUsed()
297
    public function getUsed()
298
    {
298
    {
299
        return $this->_used;
299
        return $this->_used;
300
    }
300
    }
301
 
301
 
302
    /**
302
    /**
303
     * Sets $_used.
303
     * Sets $_used.
304
     *
304
     *
305
     * @param Integer $used used bytes
305
     * @param int $used used bytes
306
     *
306
     *
307
     * @see DiskDevice::$_used
307
     * @see DiskDevice::$_used
308
     *
308
     *
309
     * @return Void
309
     * @return void
310
     */
310
     */
311
    public function setUsed($used)
311
    public function setUsed($used)
312
    {
312
    {
313
        $this->_used = $used;
313
        $this->_used = $used;
314
    }
314
    }
Line 316... Line 316...
316
    /**
316
    /**
317
     * Returns $_ignore.
317
     * Returns $_ignore.
318
     *
318
     *
319
     * @see DiskDevice::$_ignore
319
     * @see DiskDevice::$_ignore
320
     *
320
     *
321
     * @return Integer
321
     * @return int
322
     */
322
     */
323
    public function getIgnore()
323
    public function getIgnore()
324
    {
324
    {
325
        return $this->_ignore;
325
        return $this->_ignore;
326
    }
326
    }
Line 328... Line 328...
328
    /**
328
    /**
329
     * Sets $_ignore.
329
     * Sets $_ignore.
330
     *
330
     *
331
     * @see DiskDevice::$_ignore
331
     * @see DiskDevice::$_ignore
332
     *
332
     *
333
     * @return Void
333
     * @return void
334
     */
334
     */
335
    public function setIgnore($ignore)
335
    public function setIgnore($ignore)
336
    {
336
    {
337
        $this->_ignore = $ignore;
337
        $this->_ignore = $ignore;
338
    }
338
    }