Another high level first pass at an important topic for Magento 2 developers. Corrections and clarifications are more than welcome. Magento 2, like Magento 1, has a “web” API. This has nothing to do with the @api notation on classes, methods, and interfaces. The Web API is a way for programmers to programmatically interact [...]
astorm
Another Shell Scripts for M2 Setup This time from Karen over at Web Shop Apps. It’s slower than we’d all like, but things are starting to consolidate around Magento 2 development.
astorm
Shell Script to Install Magento 2 Havne’t tried it yet, but this shell script purports to offer a simplified Magento 2 installer experience. Glad to see these sorts of things bubbling up to the surface.
astorm
Magento Travis Build Starter Travis is a popular, hosted system for automatically creating test environments for open source projects hosted on a GitHub. The word automatic can be a little misleading though – Travis hooks up to the GitHub API, handles spawning new virtual machines (presumably at AWS/EC2), and has a simple domain [...]
astorm
Removing a Block from Magento 2 Layouts I’ve dug into the Magento 2 layout enough to discover that On the PHP level, there are methods for removing/unsetting a block from the layout That these methods are not exposed via the Layout DSL
astorm
If you’ve read previous articles on the subject, you know that every URL in Magento 2 corresponds to a single controller file, and each controller file has a single execute method. This execute method is responsible for returning a “result” object (i.e. an object that implements the [...]
astorm
Thanks to Magento 2’s MVVM approach the traditional responsibilities of a controller object have been pushed into the “view model” layer (i.e. a block’s _prepareLayout method). The main job a controller performs in Magento 2 is to Determine what sort of response is needed (HTML page, JSON, Redirect) Create an [...]
astorm
Magento 2 validates most, if not all, of its XML configuration files via a schema document. If you’re dealing with someone else’s code and you need to jump to the source of a schema problems, here’s a debugging snippet. #File: vendor/magento/framework/Config/Dom.php public function validate($schemaFileName, &$errors [...]
astorm
This one's just a quick commercial interruption to let everyone know Pulse Storm has recently released Commerce Bug 3 for both Magento 1 and Magento 2 systems. Commerce Bug is a programmers debugging extension and in-browser IDE. The official press releases for the 3
astorm
A quick primer on running Magento 2’s development tests. Most of this is just reworded information from Vinai Kopp guiding me through. If you’re working with the Magento 2 GitHub repository, you can run the project’s unit tests with vendor/bin/phpunit -c dev/tests/unit/phpunit.xml This assumes you’ve copied [...]
astorm
PHP – Object equivalent of array_slice(); PHP’s built in interfaces for advanced object functionality remain a hidden feature of the language that too many developers don’t understand. In this Stack Exchange answer I outline the basics of how Magento 1 uses those interfaces for collection functionality, and why you [...]
astorm
I’m working on a few projects converting old Magento 1 extensions to Magento 2. One extension I was working on had a “frontend area checker” in an observer that would return early if the request didn’t happen on the frontend. Like any good refactoring programmer, rather than spend days trying to piece together why [...]
astorm
Alternate Magento 1 Configuration Model There’s a handful of classes you can’t rewrite in Magento 1, but more modern version of Magento provide a way to slot in your own configuration class. I still wish I lived in the alternate universe where Varien had the resources to take the brilliant parts of Magento 1 and refine them [...]
astorm
Today we're going to cover creating Magento 2 CRUD models. CRUD stands for Create, Read, Update, and Delete, and commonly refers to framework features used to read and write information to/from the underlying database without directly writing any SQL statements.
astorm