]> git.datanom.net - omvzfs.git/commitdiff
Use OMVUtil::exec
authorMichael Rasmussen <mir@datanom.net>
Sun, 2 Mar 2014 23:03:25 +0000 (00:03 +0100)
committerMichael Rasmussen <mir@datanom.net>
Sun, 2 Mar 2014 23:03:25 +0000 (00:03 +0100)
src/Dataset.php

index afdd172c535a34827f4e4cc8814ce47b50ffb6e9..025126ad167a6d09426b2184229093b592da5a3c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 require_once("Exception.php");
+require_once("openmediavault/util.inc");
 
 /**
  * XXX detailed description
@@ -38,7 +39,7 @@ class OMVModuleZFSDataset {
 
        /**
         * Constructor
-        * 
+        *
         * @param string $name Name of the new Dataset
         * @param array $features An array of features (strings) in the form <key>=<value> to set when creating the Dataset
         * @throws OMVModuleZFSException
@@ -52,7 +53,7 @@ class OMVModuleZFSDataset {
                        }
                }
                $cmd .= $name . " 2>&1";
-               exec($cmd,$out,$res);
+               OMVUtil::exec($cmd,$out,$res);
                if ($res == 1) {
                        throw new OMVModuleZFSException(implode("\n", $out));
                }
@@ -106,13 +107,13 @@ class OMVModuleZFSDataset {
         * Sets a number of Dataset properties. If a property is already set it will be updated with the new value.
         *
         * @param  array $features An array of strings in format <key>=<value>
-        * @return void 
+        * @return void
         * @access public
         */
        public function setFeatures($features) {
                foreach ($features as $newfeature) {
                        $cmd = "zfs set " . $newfeature . " " . $this->name;
-                       exec($cmd,$out,$res);
+                       OMVUtil::exec($cmd,$out,$res);
                        if ($res == 1) {
                                throw new OMVModuleZFSException(implode("\n", $out));
                        }
@@ -140,7 +141,7 @@ class OMVModuleZFSDataset {
         */
        public function destroy() {
                $cmd = "zfs destroy " . $this->name;
-               exec($cmd,$out,$res);
+               OMVUtil::exec($cmd,$out,$res);
                if ($res == 1) {
                        throw new OMVModuleZFSException(implode("\n", $out));
                }
This page took 0.033507 seconds and 5 git commands to generate.