MaxServ / t3ext-fal_s3

S3 driver for FAL
GNU General Public License v2.0
13 stars 10 forks source link

Action "Clear processed files" can not be used in install tool #41

Closed maechler closed 6 years ago

maechler commented 6 years ago

Currently it is not possible to use "Clear processed files" in order to clear processed files that are saved to the FalS3 storage.

The first error message is as follows:

Desired storage "MaxServ.FalS3" is not in the list of available storages.

That is because registering the driver in ext_localconf.php does not work in the install tool. To fix this issue one has to add this config to AdditionalConfiguration.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'][\MaxServ\FalS3\Driver\AmazonS3Driver::DRIVER_KEY] = [
    'shortName' => \MaxServ\FalS3\Driver\AmazonS3Driver::DRIVER_KEY,
    'class' => \MaxServ\FalS3\Driver\AmazonS3Driver::class,
    'label' => 'S3 driver for FAL',
    'flexFormDS' => 'FILE:EXT:fal_s3/Configuration/FlexForm/AmazonS3DriverFlexForm.xml'
];

Now the driver can be found, but there seems to still be an autoloading issue:

Call to undefined function Aws\manifest() 

Error thrown in file
/var/www/example.ch/typo3conf/ext/aws_sdk_php/Contrib/Aws/AwsClient.php in line 153.
arnoschoon commented 6 years ago

Hi @maechler,

this seems to be caused by the install tool which doesn't load this kind of third party extensions, I'm sorry but you should discuss this with the authors of the core.

As for the autoloading issue, my guess is that using Composer will fix that.

maechler commented 6 years ago

Does that mean it works for you when using composer mode? Without the configuration I mentioned to AdditionalConfiguration.php?

Because to me it seemed that registering the driver in ext_localconf.php, as you do, did not work in the install tool: https://github.com/MaxServ/t3ext-fal_s3/blob/4be8906a3d0dcfbad1834ff15f06e0084cccce51/ext_localconf.php#L6-L16

If that does not work, this would be an issue of fal_s3 that at least could be added to the docs.

I guess the autoloading issue could be solved by requiring aws-autoloader.php from EXT:aws_sdk_php. That error occurs probably just because we are not in composer mode. I will test this.

arnoschoon commented 6 years ago

Nope, it doesn't work in COMPOSER_MODE either, but at least the references in sys_file are cleaned, I use https://github.com/aws/aws-cli to remove files from the actual storage. Using the "Clear processed files" action is not something you want to happen from the CMS on an high-traffic production platform (most likely it'll involve actions on CloudFront or other components in your setup as well).