LocalFilesystemAdapter example

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,

            // How to deal with links, either DISALLOW_LINKS or SKIP_LINKS             // Disallowing them causes exceptions when encountered
Home | Imprint | This part of the site doesn't use cookies.