X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/f891182fc1ca2217dfab6d0a90cf30b22d03545b..ba6cf545d4cb6312a9ac99b04827ccac7a33c039:/src/Dataset.php diff --git a/src/Dataset.php b/src/Dataset.php index 210fc6e..49ddfb2 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -1,4 +1,5 @@ &1"; + exec($cmd,$out,$res); + if ($res == 1) { + throw new OMVModuleZFSException(implode("\n", $out)); + } + unset($res); + $this->name = $name; + if (isset($features)) { + $this->features = $features; + foreach ($features as $feature) { + if (preg_match('/^mountpoint\=(.*)$/', $feature, $res)) { + $this->mountPoint = $res[1]; + continue; + } + } + } else { + $this->features = array(); + $this->mountPoint = "/" . $name; + } + } - /** - * XXX - * - * @return string XXX - * @access public - */ - public function getMountPoint() { - trigger_error('Not Implemented!', E_USER_WARNING); - } + /** + * Return name of the Dataset + * + * @return string $name + * @access public + */ + public function getName() { + return $this->name; + } - /** - * XXX - * - * @return array XXX - * @access public - */ - public function getFeatures() { - trigger_error('Not Implemented!', E_USER_WARNING); - } + /** + * Get the size of the Dataset + * + * @return int $size + * @access public + */ + public function getSize() { + return $this->size; + } - /** - * XXX - * - * @param array XXX - * @return void XXX - * @access public - */ - public function setFeatures($list) { - trigger_error('Not Implemented!', E_USER_WARNING); - } + + /** + * Get the mountpoint of the Dataset + * + * @return string $mountPoint + * @access public + */ + public function getMountPoint() { + return $this->mountPoint; + } + + /** + * Get an array of features associated with the Dataset + * + * @return array $features + * @access public + */ + public function getFeatures() { + return $this->features; + } + + /** + * XXX + * + * @param array XXX + * @return void XXX + * @access public + */ + public function setFeatures($list) { + trigger_error('Not Implemented!', E_USER_WARNING); + } }