src/File/Writer/DefaultWriter.php
public function getFilesystem($field, array $settings = [])
    {
        $adapter = new Local(Hash::get($settings, 'filesystem.root', ROOT . DS));
        $adapter = Hash::get($settings, 'filesystem.adapter', $adapter);
        if (is_callable($adapter)) {
            $adapter = $adapter();
        }

        if ($adapter instanceof AdapterInterface) {
            return new Filesystem($adapter, Hash::get($settings, 'filesystem.options', [
                'visibility' => AdapterInterface::VISIBILITY_PUBLIC
            ]));
        }

        throw new UnexpectedValueException(sprintf("Invalid Adapter for field %s", $field));
    }
public function getFilesystem($field, array $settings = [])
    {
        $adapter = new Local(Hash::get($settings, 'filesystem.root', ROOT . DS));
        $adapter = Hash::get($settings, 'filesystem.adapter', $adapter);
        if (is_callable($adapter)) {
            $adapter = $adapter();
        }

        if ($adapter instanceof AdapterInterface) {
            return new Filesystem($adapter, Hash::get($settings, 'filesystem.options', [
                'visibility' => AdapterInterface::VISIBILITY_PUBLIC
            ]));
        }

        throw new UnexpectedValueException(sprintf("Invalid Adapter for field %s", $field));
    }
public function getFilesystem ( $ field , array $ settings = [ ] ) { $ adapter = new Local ( Hash :: get ( $ settings , 'filesystem.root' , ROOT . DS ) ) ; $ adapter = Hash :: get ( $ settings , 'filesystem.adapter' , $ adapter ) ; if ( is_callable ( $ adapter ) ) { $ adapter = $ adapter ( ) ; } if ( $ adapter instanceof AdapterInterface ) { return new Filesystem ( $ adapter , Hash :: get ( $ settings , 'filesystem.options' , [ 'visibility' => AdapterInterface :: VISIBILITY_PUBLIC ] ) ) ; } throw new UnexpectedValueException ( sprintf ( "Invalid Adapter for field %s" , $ field ) ) ; }
Retrieves a configured filesystem for the given field

@param string $field the field for which data will be saved
@param array $settings the settings for the current field
@return \League\Flysystem\FilesystemInterface
Retrieves a configured filesystem for the given field