Converting a Joined Resultset Into a Hierarchy

I needed nested resultsets in some projects. I’ve seen a lot of StackOverflow chatter which essentially pointed people towards Doctrine or Propel ORMs, which was overkill when you didn’t want mapping or even model classes. I built a very small function that will transform joined results into a hierarchy. This avoids using heavy ORMs if you just…

Read More

Naming functions consistently

I believe that in order to write readable and maintainable code, we must name our functions in a consistent way. What I noticed by reading a lot of code, especially frameworks, is that developers use too many different verbs when naming functions. It’s even worse when the verbs are meaningless, such as handle, execute, do, match,…

Read More

Composer Security Checker

Stefan Priebsch made some very interesting points in his IPC talk about dependencies. Someone in the audience asked how often should we update our dependencies. Stefan recommends not to touch dependencies if everything is working and only monitor for security updates. However, monitoring security updates for a big dependency tree would be tedious. Here comes my…

Read More

Magento 1.9 on PHP7

I tested many applications on PHP7 and only one of them had an issue: Magento 1.9. The issue was very easy to fix. I couldn’t find a way to submit a patch because only Magento 2 was on GitHub, so here’s the patch if you decide to upgrade. File: app/code/core/Mage/Core/Model/Layout.php Inside function getOutput(), change this line:

to this:…

Read More

Conference travel expenses

Some conferences cover expenses of their speakers, other conferences don’t. Travel and accommodation can be extremely expensive and some speakers wonder why a conference would choose to put that burden on the speakers. There are many ways to run a conference. I believe that all conference models are valid. Ticket price The price of a ticket…

Read More