Code Duplication    Length = 29-29 lines in 3 locations

lib/elFinderVolumeDropbox.class.php 1 location

@@ 751-779 (lines=29) @@
748
     * @author Dmitry (dio) Levashov
749
     * @author Naoki Sawada
750
     */
751
    protected function remove($path, $force = false, $recursive = false)
752
    {
753
        $stat = $this->stat($path);
754
        $stat['realpath'] = $path;
755
        $this->rmTmb($stat);
756
        $this->clearcache();
757
758
        if (empty($stat)) {
759
            return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
760
        }
761
762
        if (! $force && ! empty($stat['locked'])) {
763
            return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
764
        }
765
766
        if ($stat['mime'] == 'directory') {
767
            if (! $recursive && ! $this->_rmdir($path)) {
768
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
769
            }
770
        } else {
771
            if (! $recursive && ! $this->_unlink($path)) {
772
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
773
            }
774
        }
775
776
        $this->removed[] = $stat;
777
778
        return true;
779
    }
780
781
    /**
782
     * Create thumnbnail and return it's URL on success.

lib/elFinderVolumeDropbox2.class.php 1 location

@@ 754-782 (lines=29) @@
751
     *
752
     * @author Naoki Sawada
753
     **/
754
    protected function remove($path, $force = false, $recursive = false)
755
    {
756
        $stat = $this->stat($path);
757
        $stat['realpath'] = $path;
758
        $this->rmTmb($stat);
759
        $this->clearcache();
760
761
        if (empty($stat)) {
762
            return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
763
        }
764
765
        if (! $force && ! empty($stat['locked'])) {
766
            return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
767
        }
768
769
        if ($stat['mime'] == 'directory') {
770
            if (! $recursive && ! $this->_rmdir($path)) {
771
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
772
            }
773
        } else {
774
            if (! $recursive && ! $this->_unlink($path)) {
775
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
776
            }
777
        }
778
779
        $this->removed[] = $stat;
780
781
        return true;
782
    }
783
784
    /**
785
     * Create thumnbnail and return it's URL on success.

lib/elFinderVolumeGoogleDrive.class.php 1 location

@@ 1173-1201 (lines=29) @@
1170
     * @author Dmitry (dio) Levashov
1171
     * @author Naoki Sawada
1172
     **/
1173
    protected function remove($path, $force = false, $recursive = false)
1174
    {
1175
        $stat = $this->stat($path);
1176
        $stat['realpath'] = $path;
1177
        $this->rmTmb($stat);
1178
        $this->clearcache();
1179
1180
        if (empty($stat)) {
1181
            return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
1182
        }
1183
1184
        if (! $force && ! empty($stat['locked'])) {
1185
            return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
1186
        }
1187
1188
        if ($stat['mime'] == 'directory') {
1189
            if (! $recursive && ! $this->_rmdir($path)) {
1190
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
1191
            }
1192
        } else {
1193
            if (! $recursive && ! $this->_unlink($path)) {
1194
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
1195
            }
1196
        }
1197
1198
        $this->removed[] = $stat;
1199
1200
        return true;
1201
    }
1202
1203
    /**
1204
     * Create thumnbnail and return it's URL on success.