On Thu, Dec 23, 2010 at 1:47 PM, Chad innocentkiller@gmail.com wrote:
Well it's in trunk now[0] (plus a few followups). It's shorter, yes. Some profiling before/after would probably be good.
It's shorter by only a handful of lines, at the expense of using an obscure library rather than built-in PHP functions. Actually, not only are opendir()/readdir()/closedir() built-in PHP functions, they've been the standard way to manipulate directories in Unix for decades. And even if you've never seen them before, they're very simple to understand. The longest segment of code replaced was six lines. I don't see this change as a win at all.
Put another way -- the total change is not shorter. It removes maybe 20 lines, and adds over 800. It's a drastic increase in overall complexity given how few calls we have of this type. If we were doing this type of stuff a lot, then it would definitely make sense to abstract the work out to a library to reduce errors -- but we're not.