]>
Commit | Line | Data |
---|---|---|
f891182f MR |
1 | <?php |
2 | ||
3 | /** | |
4 | * XXX detailed description | |
5 | * | |
6 | * @author XXX | |
7 | * @version XXX | |
8 | * @copyright XXX | |
9 | */ | |
63617ac2 | 10 | class OMVModuleZFSZvol { |
4e7d4caf NB |
11 | // Attributes |
12 | ||
13 | /** | |
14 | * Name of Zvol | |
15 | * | |
16 | * @var string $name | |
17 | * @access private | |
18 | */ | |
19 | private $name; | |
f891182f | 20 | |
4e7d4caf NB |
21 | /** |
22 | * Size of Zvol | |
23 | * | |
24 | * @var int $size | |
25 | * @access private | |
26 | */ | |
27 | private $size; | |
f891182f | 28 | |
4e7d4caf NB |
29 | /** |
30 | * Mountpoint of the Zvol | |
31 | * | |
32 | * @var string $mountPoint | |
33 | * @access private | |
34 | */ | |
35 | private $mountPoint; | |
f891182f | 36 | |
4e7d4caf NB |
37 | /** |
38 | * Array with properties assigned to the Zvol | |
39 | * | |
40 | * @var array $properties | |
41 | * @access private | |
42 | */ | |
43 | private $properties; | |
f891182f | 44 | |
4e7d4caf NB |
45 | // Associations |
46 | // Operations | |
47 | /** | |
48 | * XXX | |
49 | * | |
50 | * @return string XXX | |
51 | * @access public | |
52 | */ | |
53 | public function getName() { | |
54 | trigger_error('Not Implemented!', E_USER_WARNING); | |
55 | } | |
f891182f | 56 | |
4e7d4caf NB |
57 | /** |
58 | * XXX | |
59 | * | |
60 | * @return int XXX | |
61 | * @access public | |
62 | */ | |
63 | public function getSize() { | |
64 | trigger_error('Not Implemented!', E_USER_WARNING); | |
65 | } | |
f891182f | 66 | |
4e7d4caf NB |
67 | /** |
68 | * XXX | |
69 | * | |
70 | * @return string XXX | |
71 | * @access public | |
72 | */ | |
73 | public function getMountPoint() { | |
74 | trigger_error('Not Implemented!', E_USER_WARNING); | |
75 | } | |
f891182f | 76 | |
4e7d4caf NB |
77 | /** |
78 | * XXX | |
79 | * | |
80 | * @return list<Feature> XXX | |
81 | * @access public | |
82 | */ | |
83 | public function getProperties() { | |
84 | trigger_error('Not Implemented!', E_USER_WARNING); | |
85 | } | |
f891182f | 86 | |
4e7d4caf NB |
87 | /** |
88 | * XXX | |
89 | * | |
90 | * @param $list<Feature> XXX | |
91 | * @return void XXX | |
92 | * @access public | |
93 | */ | |
94 | public function setProperties($properties) { | |
95 | trigger_error('Not Implemented!', E_USER_WARNING); | |
96 | } | |
97 | ||
98 | /** | |
99 | * Helper function to execute a command and throw an exception on error | |
100 | * (requires stderr redirected to stdout for proper exception message). | |
101 | * | |
102 | * @param string $cmd Command to execute | |
103 | * @param array &$out If provided will contain output in an array | |
104 | * @param int &$res If provided will contain Exit status of the command | |
105 | * @return string Last line of output when executing the command | |
106 | * @throws OMVModuleZFSException | |
107 | * @access private | |
108 | */ | |
109 | private function exec($cmd, &$out = null, &$res = null) { | |
110 | $tmp = OMVUtil::exec($cmd, $out, $res); | |
111 | if ($res) { | |
112 | throw new OMVModuleZFSException(implode("\n", $out)); | |
113 | } | |
114 | return $tmp; | |
115 | } | |
f891182f MR |
116 | |
117 | } | |
118 | ||
119 | ?> |