yireo / Yireo_NextGenImages

44 stars 26 forks source link

Use `Magento\Framework\Filesystem`, to allow override by RemoteStorage #17

Closed lphilippo closed 2 years ago

lphilippo commented 2 years ago

While working on a plugin to integrate this module with Magento's RemoteStorage, we'd like to propose a few changes to increase the flexibility for such inheritance.

By using Filesystem $filesystem, a module can link this constructor parameter by their standard way:

    <type name="Yireo\NextGenImages\Image\File">
        <arguments>
            <argument name="filesystem" xsi:type="object">fullRemoteFilesystem</argument>
        </arguments>
    </type>

For the private properties, only the $fileDriver itself is most likely to be needed, hence the change from private to protected. With these changes the integration works correctly, although we're still in the process of testing the different features (most importantly the direct conversion on upload).

jissereitsma commented 2 years ago

I didn't really put much thoughts to it. Adding it and releasing it right away!

jissereitsma commented 2 years ago

Included in 0.2.12 :)