Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Strategic Archive Extraction with Distill
Oct 27, 2014 @ 17:09:54

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.

tagged: tutorial extract archive distill library tool

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

Engine Yard Blog:
Learning Rails (and Ruby)
Apr 11, 2013 @ 15:33:31

Davey Shafik, a long-time PHP developer and community member/speaker, recently had to learn Ruby on Rails for a project at work. He's shared some of the experience (from the perspective of a PHP developer) in a recent post on the Engine Yard blog.

I know PHP. I mean, I really know PHP. Not just the syntax, or the idioms and idiosyncrasies, but why. I can tell you why something works the way it does, under the hood; and I was probably around when the decision was made to do it that way. Thirteen years with any language is a long time. [...] Ultimately, it comes down to: Is it the right tool for the task? Because of this, ultimately when I come to write a web site, PHP is my tool of choice. Know thy tool well, and it shall treat you well. Then along came Engine Yard, and I was exposed to just a ton of fantastic engineers who happen to choose Ruby as their tool of choice.

His project was the site for the Distill conference Engine Yard is putting on in August. He lists a few "WTF" moments he came across when learning and creating the site with Ruby including issues with parentheses on metod calls, method naming rules, implicit returns and variations on control structures. He also talks about some of the other technologies used to power the site like OAuth and S3 for image uploads (via paperclip). He finishes out the post by wrapping up the experience and talking some about the benefits of getting outside your comfort zone and learning something wildly new (language or other technology) to give you perspective.

tagged: developer perspective distill learn language rubyonrails

Link: https://blog.engineyard.com/2013/learning-rails-and-ruby


Trending Topics: