Jump to content

Request Proper File Storage Handler Extension

All Astronauts

Recommended Posts

@Martin A., after getting the low-down from me on this hitch, suggested this should be brought up to you guys before 4.5 is feature locked. I suspect this deadline may have already passed but this still would be nice to get fixed up.

PROBLEM: Alternative storage handlers (e.g. non-Amazon S3 providers, Azure, etc.) when added via 3rd party applications will crash routine IPS upgrades.

If you add a new file storage service (S3 alternative, whatever), such that it really is there, existing as a source file in your app, and correctly listed in core_file_storage (method field) and you hook onto \IPS\File\storageHandlers, you have no problems - everything works seamlessly - until you upgrade. During the upgrade process, that method is hit, minus any hooks, and the upgrade fails at that point as it tries to understand why there are files with a storageHandler that doesn't exist. 

That method is locked down to only providing the built-in IPS options of FileSystem, Amazon (S3), Database, and the depreciated FTP. When hooked by your application, again, everything is fine. During upgrades however, that hook will not be used, leaving only those IPS default options as valid.

It's easy to skip around this by directly altering the upgrade url to skip to the next step, but it's a show-stopper for a Marketplace or production release (unless you have a direct hand on the upgrade process for the site in question)

The "easy" solution would be to adjust the hard-coded array the \IPS\File\storageHandler method returns somehow. You could change the core_file_storage database method field to store the entire class name instead of just the end bit - that is, store\IPS\File\FileSystem instead of just FileSystem - 3rd party apps would end up in there as \IPS\MyApp\MyStorageHandler, and then just read that out for that storageHandler method BUT you'd still have to muck about in many other places to account for this and the more I think about it it's likely too messy in the end.

Given that, an extension seems to be the much better option. 

For the few of us who are running customs on these, this isn't the end of the world (it's just skipping the upgrade step), but if allowing more file storage services to be available to end-users to appear via the Marketplace is going to happen, this will need to be addressed eventually.

Link to comment
Share on other sites

For what it's worth, can't speak for others, but I'd feel more comfortable with an extension of some sort.

And thanks.

EDIT: and appreciate the fact that endusers are dumb and may uninstall the app that provides the storage handler or that the app might get toggled off in the ACP for whatever reasons. When you start moving down that rabbit hole, it gets dark and ugly real fast.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...