Posts Tagged themes

I’m Back!

So I got back Sunday from camping — and sunburned, as usual — and I have resumed work on SnowCMS, but I have yet to commit anything.

Right now I am working on a new class called Extractor which will do what one might think: extract files, such as zips, tarballs and gzipped tarballs without having to detect the compression method used manually.

Additionally I have created an Extraction interface which may be implemented to support the extraction of other compression methods.

With this new Extractor class I also worked on updating the current Zip and Tar classes to add a new method called read. This new method allows files to be retrieved from the compressed file without having to decompress the entire package. This individual file may be returned or saved to a specified file.

This may sound insignificant (or that I am going off-track from what I have been working on lately), but it allows the process of installing and updating themes and plugins more efficiently.

Currently a package (theme or plugin) is extracted to make sure the package can actually be extracted and to make sure that the package is valid (e.g. a real theme or plugin), then its status is checked. If the status check finds that the package is not approved the user must choose to continue with the installation, if they do the page is refreshed and everything up to this point is redone, but the status returned is ignored. Now the compatibility of the package is checked and if it isn’t compatible the user is once again asked to continue with installation anyways, if so the process is once again repeated.

This means the package could be extracted up to three different times (the extracted package is removed on each page load in case the user leaves the page). This needs to occur to make sure the compressed package can be decompressed and to make sure the right files exist and to check its compatibility with the system.

Now that files can be extracted individually the package does not need to be extracted over and over again, making the process much more efficient.

Just thought I’d let you know ;-)

, ,

No Comments