Re: Plugin uploading
Reply #2 –
The hardest part, oddly enough, was figuring out FTP - SMF (and thus both Wedge and Elkarte) bundles a usable FTP library but it doesn't have methods for putting content to a server, nor does it support enhanced passive connections (i.e. FTP over IPv6), which are the biggest hurdles to this. I'm not even sure if the get method for downloading a file was even present, now that I think about it. I have a vague recollection of adding other utility methods such as getting a raw directory listing, but I forget how much of that was originally SMF code, I haven't checked.
The zip traversal is actually my own library, built specifically for parsing and extraction. I was originally going to use PclZip, but PclZip is very big (199KB, though I did manage to get it down to 80KB through cleaning it up) and from my perspective bloated; the entirety of it reads like a C script, every method returns a number indicating success (0 for success, any other number for error) and everything is otherwise passed by reference, and since that means everything is using $v_ and $p_ prefixes on everything (indicating local variable vs foreign pointer/reference), I found it largely unreadable.
I threw a lot of zip files at the new class (which is barely 18KB) and couldn't get anything to break it that shouldn't break it, but you never know heh.