src/ElFinder/ElFinder.php
protected function mountVolumes($opts)
    {
        foreach ($opts['roots'] as $i => $o) {
            $class = 'elFinderVolume'.(isset($o['driver']) ? $o['driver'] : '');

            if (class_exists($class)) {
                $volume = new $class();

                try {
                    if ($this->maxArcFilesSize && (empty($o['maxArcFilesSize']) || $this->maxArcFilesSize < $o['maxArcFilesSize'])) {
                        $o['maxArcFilesSize'] = $this->maxArcFilesSize;
                    }
                    // pass session handler
                    $volume->setSession($this->session);
                    if ($volume->mount($o)) {
                        // unique volume id (ends on "_") - used as prefix to files hash
                        $id = $volume->id();

                        $this->volumes[$id] = $volume;
                        if ((!$this->default || $volume->root() !== $volume->defaultPath()) && $volume->isReadable()) {
                            $this->default = $this->volumes[$id];
                        }
                    } else {
                        $this->removeNetVolume($i, $volume);
                        $this->mountErrors[] = 'Driver "'.$class.'" : '.implode(' ', $volume->error());
                    }
                } catch (Exception $e) {
                    $this->removeNetVolume($i, $volume);
                    $this->mountErrors[] = 'Driver "'.$class.'" : '.$e->getMessage();
                }
            } else {
                $this->removeNetVolume($i, $volume);
                $this->mountErrors[] = 'Driver "'.$class.'" does not exist';
            }
        }
    }
protected function mountVolumes($opts)
    {
        foreach ($opts['roots'] as $i => $o) {
            $class = 'elFinderVolume'.(isset($o['driver']) ? $o['driver'] : '');

            if (class_exists($class)) {
                $volume = new $class();

                try {
                    if ($this->maxArcFilesSize && (empty($o['maxArcFilesSize']) || $this->maxArcFilesSize < $o['maxArcFilesSize'])) {
                        $o['maxArcFilesSize'] = $this->maxArcFilesSize;
                    }
                    // pass session handler
                    $volume->setSession($this->session);
                    if ($volume->mount($o)) {
                        // unique volume id (ends on "_") - used as prefix to files hash
                        $id = $volume->id();

                        $this->volumes[$id] = $volume;
                        if ((!$this->default || $volume->root() !== $volume->defaultPath()) && $volume->isReadable()) {
                            $this->default = $this->volumes[$id];
                        }
                    } else {
                        $this->removeNetVolume($i, $volume);
                        $this->mountErrors[] = 'Driver "'.$class.'" : '.implode(' ', $volume->error());
                    }
                } catch (Exception $e) {
                    $this->removeNetVolume($i, $volume);
                    $this->mountErrors[] = 'Driver "'.$class.'" : '.$e->getMessage();
                }
            } else {
                $this->removeNetVolume($i, $volume);
                $this->mountErrors[] = 'Driver "'.$class.'" does not exist';
            }
        }
    }
protected function mountVolumes ( $ opts ) { foreach ( $ opts [ 'roots' ] as $ i => $ o ) { $ class = 'elFinderVolume' . ( isset ( $ o [ 'driver' ] ) ? $ o [ 'driver' ] : '' ) ; if ( class_exists ( $ class ) ) { $ volume = new $ class ( ) ; try { if ( $ this -> maxArcFilesSize && ( empty ( $ o [ 'maxArcFilesSize' ] ) || $ this -> maxArcFilesSize < $ o [ 'maxArcFilesSize' ] ) ) { $ o [ 'maxArcFilesSize' ] = $ this -> maxArcFilesSize ; } // pass session handler $ volume -> setSession ( $ this -> session ) ; if ( $ volume -> mount ( $ o ) ) { // unique volume id (ends on "_") - used as prefix to files hash $ id = $ volume -> id ( ) ; $ this -> volumes [ $ id ] = $ volume ; if ( ( ! $ this -> default || $ volume -> root ( ) !== $ volume -> defaultPath ( ) ) && $ volume -> isReadable ( ) ) { $ this -> default = $ this -> volumes [ $ id ] ; } } else { $ this -> removeNetVolume ( $ i , $ volume ) ; $ this -> mountErrors [ ] = 'Driver "' . $ class . '" : ' . implode ( ' ' , $ volume -> error ( ) ) ; } } catch ( Exception $ e ) { $ this -> removeNetVolume ( $ i , $ volume ) ; $ this -> mountErrors [ ] = 'Driver "' . $ class . '" : ' . $ e -> getMessage ( ) ; } } else { $ this -> removeNetVolume ( $ i , $ volume ) ; $ this -> mountErrors [ ] = 'Driver "' . $ class . '" does not exist' ; } } }
Mount volumes.

Instantiate corresponding driver class and
add it to the list of volumes.

@param array $opts
Mount volumes .