resolveOptions example

use League\Flysystem\FilesystemAdapter;
use League\Flysystem\Local\LocalFilesystemAdapter;
use League\Flysystem\UnixVisibility\PortableVisibilityConverter;
use Shopware\Core\Framework\Log\Package;
use Symfony\Component\OptionsResolver\OptionsResolver;

#[Package('core')] class LocalFactory implements AdapterFactoryInterface
{
    public function create(array $config): FilesystemAdapter
    {
        $options = $this->resolveOptions($config);

        return new LocalFilesystemAdapter(
            $options['root'],
            PortableVisibilityConverter::fromArray([
                'file' => $options['file'],
                'dir' => $options['dir'],
            ]),

            // Write flags             \LOCK_EX,

            

    /** * @return Local */
    public function create(array $config)
    {
        if (isset($config['path'])) {
            $config['root'] = $config['path'];
            unset($config['path']);
        }

        $options = $this->resolveOptions($config);

        return new Local(
            $options['root'],
            LOCK_EX,
            Local::DISALLOW_LINKS,
            $options
        );
    }

    /** * @return string */
Home | Imprint | This part of the site doesn't use cookies.