]> git.datanom.net - omvzfs.git/blobdiff - gui/rpc/zfs.inc
replace deprecated function join with implode
[omvzfs.git] / gui / rpc / zfs.inc
index bdf8c442179a009004486963d9703ef306d02454..48c7ef40a32c524c5a414096e90e2ef79a228831 100644 (file)
@@ -70,7 +70,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
        public function deleteObject($params, $context) {
                $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
                switch ($params['type']) {
        public function deleteObject($params, $context) {
                $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
                switch ($params['type']) {
-               case "Filesystem" || "Clone":
+               case "Filesystem":
+               case "Clone":
                        $name = $params['name'];
                        $tmp = new OMVModuleZFSDataset($name);
                        $tmp->destroy();
                        $name = $params['name'];
                        $tmp = new OMVModuleZFSDataset($name);
                        $tmp->destroy();
@@ -96,7 +97,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                $objects = array();
                $name = $params['name'];
                switch ($params['type']) {
                $objects = array();
                $name = $params['name'];
                switch ($params['type']) {
-               case "Filesystem" || "Clone":
+               case "Filesystem":
+               case "Clone":
                        $tmp = new OMVModuleZFSDataset($name);
                        break;
                case "Snapshot":
                        $tmp = new OMVModuleZFSDataset($name);
                        break;
                case "Snapshot":
@@ -125,7 +127,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
                $objects = array();
                switch ($params['type']) {
                $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
                $objects = array();
                switch ($params['type']) {
-               case "Filesystem" || "Clone":
+               case "Filesystem":
+               case "Clone":
                        $tmp = new OMVModuleZFSDataset($params['name']);
                        break;
                case "Snapshot":
                        $tmp = new OMVModuleZFSDataset($params['name']);
                        break;
                case "Snapshot":
@@ -137,7 +140,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                default:
                        throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
                        break;
                default:
                        throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
                        break;
-               }       
+               }
                foreach ($params['properties'] as $property) {
                        $objects[$property['property']] = $property['value'];
                }
                foreach ($params['properties'] as $property) {
                        $objects[$property['property']] = $property['value'];
                }
@@ -158,7 +161,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                        $bgOutputFilename = $this->createBgProcOutput();
                        $this->updateBgProcStatus($bgStatusFilename, "outputfilename", $bgOutputFilename);
                        switch ($params['type']) {
                        $bgOutputFilename = $this->createBgProcOutput();
                        $this->updateBgProcStatus($bgStatusFilename, "outputfilename", $bgOutputFilename);
                        switch ($params['type']) {
-                       case "Filesystem" || "Clone":
+                       case "Filesystem":
+                       case "Clone":
                                $tmp = new OMVModuleZFSDataset($params['name']);
                                break;
                        case "Snapshot":
                                $tmp = new OMVModuleZFSDataset($params['name']);
                                break;
                        case "Snapshot":
@@ -229,7 +233,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                // Prepare the configuration object. Use the name of the shared
                // folder as the relative directory name of the share.
                switch ($params['type']) {
                // Prepare the configuration object. Use the name of the shared
                // folder as the relative directory name of the share.
                switch ($params['type']) {
-               case "Filesystem" || "Clone":
+               case "Filesystem":
+               case "Clone":
                        $tmp = new OMVModuleZFSDataset($name);
                        break;
                default:
                        $tmp = new OMVModuleZFSDataset($name);
                        break;
                default:
@@ -239,7 +244,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
 
                $uuid = OMVUtil::uuid();
                $pathName = $tmp->getMountPoint();
 
                $uuid = OMVUtil::uuid();
                $pathName = $tmp->getMountPoint();
-               $subdirs = preg_split('/\//',$pathName);        
+               $subdirs = preg_split('/\//',$pathName);
                $reldirpath = $subdirs[count($subdirs)-1];
                $object = array(
                        "uuid" => $uuid,
                $reldirpath = $subdirs[count($subdirs)-1];
                $object = array(
                        "uuid" => $uuid,
@@ -307,7 +312,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
 }
 
 // Register the RPC service.
 }
 
 // Register the RPC service.
-$rpcServiceMgr = &OMVRpcServiceMgr::getInstance(); // Get the "root" instance for the Services 
+$rpcServiceMgr = &OMVRpcServiceMgr::getInstance(); // Get the "root" instance for the Services
 $rpcServiceMgr->registerService(new OMVRpcServiceZFS()); // Register a new instance of the RPC service described above
 ?>
 
 $rpcServiceMgr->registerService(new OMVRpcServiceZFS()); // Register a new instance of the RPC service described above
 ?>
 
This page took 0.032459 seconds and 5 git commands to generate.