Two of the biggest mind shifts I’ve had to make in coming back to C programming have been strings and variable scope/lifetime. This Stack Overflow question is a nice encasulation of both. First off — strings aren’t a first class type in C. They’re just a char array of individual characters, with a NULL character as the final [...]
astorm
In Magento 1, it was pretty common to write a bit of layout update XML that looked like the following. <reference name="head"> <action method="setLabel"> <label>skin_js</label> </action> </reference> This XML translates roughly into the following PHP pseudo code $block = $layout->getBlock('head'); [...]
astorm
One of the bigger changes to Magento 2’s layout system is how a end-user-programmer uses layout handles. In Magento 1, layout handles were top level configuration nodes in a set of layout update xml files <handle_name> <!-- layout update xml nodes --> </handle_name> In Magento 2, layout handles are individual XML [...]
astorm
Magento 2 introduced a new node type to its Layout XML DSL — the <arguments/> and <argument/> node. #File: vendor/magento/module-shipping/view/frontend/layout/sales_guest_view.xml <referenceBlock name="sales.order.view"> <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" [...]
astorm
This in an interesting Magento layout technique that came my way via Vinai Kopp (of Mage2.tv fame). Magento 2’s automatic constructor dependency injection system presents a problem for class trees with multiple levels of inheritance. First, programmers end up needing to call parent constructors with the right arguments, and in the [...]
astorm
Debugging cron jobs is one of my least favorite activities. This clever tip over on Stack Overflow shows how to use cron and the env generate the enviornmental variable your system’s cron runs under, which in turn will let you pretend to be the cron job. (This won’t help you if you’re using a PHP system that layers its [...]
astorm
This entry is part 3 of 6 in the series Just Enough C for PHP. Earlier posts include Just Enough C for PHP, and Just Enough C for PHP: Running C Programs. Later posts include Just Enough C for PHP: C Macros, There's no Such Thing as PHP, and Just Enough C for PHP: Make Basics. Today’s episode of Just Enough C for PHP is light on [...]
astorm
One long time resident of my ~/bin folder is lns lns — a friendly program for making symbolic links For whatever reason I’ve never been able to get the argument order to ln -s memorized. The lns perl script (which has always run out of the box on system provided perl without issue) make it so I never need to. Whether you lns [...]
astorm