2014年10月27日星期一

SitePoint PHP Blog: Strategic Archive Extraction with Distill


In this new tutorial from the SitePoint PHP blog about using the Distill tool to extract information and files from remote archives.



Perhaps you are building an application which depends on archives; for example, you constantly have to download archives and extract files from them. There are many libraries out there that can help you get files extracted from an archive, and a new player in town capable of doing this job is Distill. With Distill, you can easily extract an archive into a specified directory. You can also give multiple archives to Distill and let it pick the most optimal one, as per a strategy you define yourself.


He walks you through the setup of the tool (installed via Composer) and some of the basic usage. He creates a simple "Extractor" object setting the Distill object and an "extract" method that handles the actual functional part of the process. He also adds some configuration constants to the class for size checking, compression speed and random strategy types (Distill will pick the most optimal). He then makes a "chooser" method to pick the best one and calls the "extract" method to get the results.


Link: http://www.sitepoint.com/strategic-archive-extraction-distill/

没有评论:

发表评论