Changelog
v0.2.1 - 04/05/2012
- Added URL cloaking option so you can hide the fact that you're using S3
- Completely rewritten the models
- Added installer/updater - no more need for install.sql!
- No longer uses its own table to store config values
- Removed debug code I previously forgot about
- Added installation check to the plugin's config page
- Added the ability to create a bucket directly through the Opencart backend
- Tweaked the config info messages to better reflect the functionality of the pro version
- Added 3 new upload methods: "Local" upload, and two ways of selecting an existing S3 file
- Removed version from the install MySQL dump
- Fixed Opencart 1.5 theme/layout bugs
- Added MySQL table dump
- Added support for OpenCart 1.5.x
- Aws system dir is no longer hidden
- Removed version-specific VQMod files
- Stripped unnecessary comments
- Swapped filename/token so the file extension is at the end
- Added if_object_exists() check to avoid Warnings
- First release
Original post below:
Disclaimer (of sorts)
First off, it's not integration with a script as such, more a service. It's not quite a contribution yet though so I guessed this'd be the best place to post.
Some Background
I've been working on a client's site to integrate Amazon S3. They'll be selling PDF back-issues of magazines, most of which are over 100MB so instead of shelling out for a dedicated server they wanted to use Amazon S3. OpenCart is by far the easiest to use from the ones I've had experience with, and the code is generally much better than others such as Magento and Pinnacle Cart. And so, I was granted the task of getting OC+S3 to play nicely together.
Preliminary Research
I've done some searching to see if anyone had done it before, and every result said no([1]), one stating that "it won't be easy to change it to work with s3" because "the download system uses a dynamic naming convention" ([2]).
Other sources: [3] [4].
Plan for Release?
If there's enough interest I'll "vQmodularise" the extension for safer upgrades and release it. Not sure yet whether it'd be free, paid-for, or a free version and a "pro" version with extra features. It's being developed on 1.4.9.4 but I'll test other versions if I release it. For each version it works with, I'll include the two pre-patched index.php's needed for vQmod as well to save time.
What It Does Now
Currently it has a page in the backend where you enter your Account ID and Secret Key. Then a dropdown will be populated with a list of your buckets, with an option to create one if needed. Once it's setup, you simply add a download as normal and the file will be uploaded directly to your bucket without ever being saved to your server (except to PHP's tmp folder, but that's unavoidable). A customer would then come along and simply by the product as normal, accessing the link on the downloads page in My Account. All "objects" are stored in S3 with private access. As a result, using a "normal" link to the file will end up with an access denied page, so it will get a time-limited URL instead. This is currently set to 5 minutes, but I'm thinking of extending it. I've also pondered adding some Javascript to the downloads page that will auto-reload at the same interval as links expiring.
...and to summarise...
So what do you think? Is this something you'd use or have been looking for? If you wouldn't mind paying for it, what sort of price would you be happy to pay? Perhaps you'd like a free version with the choice of paying for extra features? One example could be storing downloads across different buckets rather than all-in-one. If the current implentation doesn't quite fit your needs, what's that missing feature that'd stop you from using it? If you have any ideas, post them and if enough people want it or I think it will add to the extension, then I'll probably add it in.
Think that's everything covered, probably went on a bit long though... Ahwel, "stuff" happens.