]> git.datanom.net - omvzfs.git/blob - src/Zvol.php
a26224113bd1491d1ae4d47f4bcdefd414ca0f44
[omvzfs.git] / src / Zvol.php
1 <?php
2
3 /**
4 * XXX detailed description
5 *
6 * @author XXX
7 * @version XXX
8 * @copyright XXX
9 */
10 class OMVModuleZFSZvol {
11 // Attributes
12
13 /**
14 * Name of Zvol
15 *
16 * @var string $name
17 * @access private
18 */
19 private $name;
20
21 /**
22 * Size of Zvol
23 *
24 * @var int $size
25 * @access private
26 */
27 private $size;
28
29 /**
30 * Mountpoint of the Zvol
31 *
32 * @var string $mountPoint
33 * @access private
34 */
35 private $mountPoint;
36
37 /**
38 * Array with properties assigned to the Zvol
39 *
40 * @var array $properties
41 * @access private
42 */
43 private $properties;
44
45 // Associations
46 // Operations
47
48 /**
49 * Return name of the Zvol
50 *
51 * @return string $name
52 * @access public
53 */
54 public function getName() {
55 return $this->name;
56 }
57
58 /**
59 * Get the mountpoint of the Zvol
60 *
61 * @return string $mountPoint
62 * @access public
63 */
64 public function getMountPoint() {
65 return $this->mountPoint;
66 }
67
68 /**
69 * Get a single property value associated with the Zvol
70 *
71 * @param string $property Name of the property to fetch
72 * @return array The returned array with the property. The property is an associative array with
73 * two elements, <value> and <source>.
74 * @access public
75 */
76 public function getProperty($property) {
77 return $this->properties["$property"];
78 }
79
80 /**
81 * Get an associative array of all properties associated with the Zvol
82 *
83 * @return array $properties Each entry is an associative array with two elements
84 * <value> and <source>
85 * @access public
86 */
87 public function getProperties() {
88 return $this->properties;
89 }
90
91
92 /**
93 * XXX
94 *
95 * @return int XXX
96 * @access public
97 */
98 public function getSize() {
99 trigger_error('Not Implemented!', E_USER_WARNING);
100 }
101
102 /**
103 * XXX
104 *
105 * @param $list<Feature> XXX
106 * @return void XXX
107 * @access public
108 */
109 public function setProperties($properties) {
110 trigger_error('Not Implemented!', E_USER_WARNING);
111 }
112
113 /**
114 * Helper function to execute a command and throw an exception on error
115 * (requires stderr redirected to stdout for proper exception message).
116 *
117 * @param string $cmd Command to execute
118 * @param array &$out If provided will contain output in an array
119 * @param int &$res If provided will contain Exit status of the command
120 * @return string Last line of output when executing the command
121 * @throws OMVModuleZFSException
122 * @access private
123 */
124 private function exec($cmd, &$out = null, &$res = null) {
125 $tmp = OMVUtil::exec($cmd, $out, $res);
126 if ($res) {
127 throw new OMVModuleZFSException(implode("\n", $out));
128 }
129 return $tmp;
130 }
131
132 }
133
134 ?>
This page took 0.066435 seconds and 4 git commands to generate.