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

NetTuts.com:
Understand Overriding in Magento: Controllers
Jul 24, 2015 @ 11:19:45

The NetTuts.com site has posted a tutorial (the third and last in their series) showing how to override controller handling in Magento. In the previous posts they showed how to override functionality related to the models and blocks (frontend layout elements).

In Magento, the controller is responsible for handling incoming requests, and it's a backbone of the Magento routing implementation. [...] As I said in the previous tutorial, it's never recommended to change core files directly, as it makes upgrading Magento really difficult. To avoid this, we should follow the standard way of making desired changes to core files: we should either use event observers or override core files with our custom module files. We'll discuss the overriding feature today.

You'll need to be familiar with custom module creation to be able to follow along (see here if not) but other than that they provide everything you'll need. They start by creating the files and folders needed for the custom module including:

  • Module XML definition (Envato_All.xml)
  • Module XML configuration
  • the Envato_Catalog_ProductController controller file (PHP)

The controller extends the pre-existing Product controller but the configuration definitions tell it ti use the "Envato" version instead.

tagged: magento overriding controller tutorial custom xml module

Link: http://code.tutsplus.com/tutorials/understand-overriding-in-magento-controllers--cms-23386

Voices of the ElePHPant:
Interview with Ben Marks
Jul 14, 2015 @ 11:47:32

The Voices of the ElePHPant podcast has posted their latest episode in their series of interviews with members of the PHP community. This time host Cal Evans talks with Ben Marks, a developer evangelist for Magento.

Cal and Ben talk about the work Ben does as a developer evangelist and how he got into the role. They also talk about how he handles the balance between the need to be social and the need to keep "doing the job" (and burnout). Ben also talks about what responsibilities he feels the role has. They also mention the eBay split (Magento is/was a part of eBay's products) and the work that's put in from that perspective to make it a good product.

You can listen to this latest episode either through the in-page audio player or by downloading the show. If you enjoy the show, be sure to subscribe to their feed and get the latest episodes as they're released.

tagged: voicesoftheelephpant community interview benmarks podcast magento

Link: https://voicesoftheelephpant.com/2015/07/14/interview-with-ben-marks/

NetTuts.com:
Create a Custom API in Magento: Part Two
Jul 03, 2015 @ 10:54:02

NetTuts.com has posted the second part of their series showing how to create a custom API in Magento. In part one of the series they focused on creating a custom module that worked with the core APIs and system. In this new post they approach it from the other side and show how to use those APIs created in part one.

In this series, we're discussing custom APIs in Magento. In the first part, we created a full-fledged custom module to implement the custom API, in which we created the required files to plug in the custom APIs provided by our module. In this second and last part, we'll go through the back-­end section to demonstrate how to consume the APIs.

They start with a quick recap of the things created in the first part of the series and how to ensure it's set up correctly to be accessed as an API endpoint. Next they set up the user and role configurations that you'll need to access the new API through the administration panel. Finally, they show you how to use the API through a simple SoapClient request.

tagged: magento custom api series tutorial part2 usage

Link: http://code.tutsplus.com/tutorials/create-a-custom-api-in-magento-part-two--cms-23821

Magenticians:
On Magento 2 being “open source” – the post-mortem
Feb 23, 2015 @ 10:12:02

On the Magenticians site there's a new post that provides an update of sorts, a post-mortem really, about their opinion of the "open source-ness" of the Magento product and project.

Little less than four months ago, we published an opinion-piece regarding Magento 2 and why we thought it wasn’t really holding up to the mindset of being an open source project. In four months, a lot has changed. [...] Magento 2 was (and still is) being marketed as a new platform which not only refreshes the entire code base, but also improves handling of the community its feedback and involvement. [...] Most of the original critique was therefore that, though by definition Magento 2 is an open source project, all the rest which should naturally come with “being open source”, severely lacked. It is one of our best read articles and linked from a dozen of websites; a timely status update is in its place.

They go on to update some of their original comments and note that things "feel more like open source" with changes including direct pushes to GitHub (not mirrored) and better external communication. They point out a few other smaller things including their developer hub, updated developer documentation and more informative blog posts about the project/project.

tagged: magento opensource postmorten improvements opinion project product

Link: http://magenticians.com/magento-2-open-source-post-mortem

Kevin Schroeder:
If you develop for Magento, know your indexes
Feb 02, 2015 @ 09:34:19

Kevin Schroeder makes a suggestion to all of the Magento developers out there - be sure to know your indexes and how to use them to your advantage.

When I first got into Magento development, in my mind, there were two ways of getting data from the database. You would either call Mage::getModel(‘catalog/product’)->load($id) or you would work with the collection. If you wanted to get a filtered list of something you would use the ORM to get it. But as I’ve gained more experience (fairly quickly, I might add) I realized that there was more to the puzzle. A good portion of this is because I work with Magento ECG and some of the best Magento devs and architects can be found there and I’m a quick learner.

He gives an example of going beyond the usual one-to-one relationship most people use with Magento's models. He includes an example of wanting to fetch a list of all products in the same category as another and the "anit-pattern" that comes with it. Instead he offers the solution of an index, a simple one that merges the catalog category and product index ID. This makes using a custom query with a handy join much easier and much faster.

tagged: magento database collection query index tutorial category

Link: http://www.eschrade.com/page/if-you-develop-for-magento-know-your-indexes/

Kevin Schroeder:
Realtime logging for Magento
Jan 14, 2015 @ 09:47:54

Kevin Schroeder has a new post to his site talking about real-time Magento logging and a library he's worked up to make it possible.

Ever since the Zend Developer Cloud started up it stirred in me some really interesting possibilities of what could be done. Sadly they never happened, but the ideas remained. If that doesn’t inspire you it’s because I’m not describing what I have in my head. I don’t have the time to do that. But this blog post is one part of it. One of the things that is part of what I envision is a realtime logger that shows what is happening, as it is happening. [Zend Server ZRay is] a cool feature but doesn’t quite go as far as I have in mind.

With that in mind I spent some time last week working on a very small piece of this vision for Magento. I wrote it really, really quickly and so don’t laugh when you look at the code and see obvious errors.

The library makes use of Magento extension and a command line program that uses a combo of Redis and PubSub for messaging back to the waiting logger. It hooks into all Magento events and allows for writing to the log from just about anywhere. It also includes a SQL profiler that will evaluate requests either in real-time or at the end of the request. He provides some additional details about the "watcher" command line tool and explanations for each of its options.

tagged: magento realtime logging library commandline tool

Link: http://www.eschrade.com/page/realtime-logging-for-magento/

7PHP.com:
Magento Certifications Tips & Tricks From Magento Certified Engineer Phillip Jackson
Jul 14, 2014 @ 09:04:17

The 7PHP.com site has a new community interview posted today, this time with Philip Jackson a Magento Certified Engineer. In this new post Khayrattee Wasseem asks him some questions about some of his own background as a developer and, more specifically, the Magento Certification and everything involved.

This is the #1st set of Magento Certification Tips and Advice to help anyone taking either of the FOUR Magento Exams powered by Magento – an Ebay Inc. Company: the Magento Front End Developer Certification, the Magento Developer Certification, the Magento Developer Plus Certification and/or the Magento Certified Solution Specialist. The aim being to help people who want to sit for those exams and inform them what it is all about & what to expect by hearing it from (pro) PHP Guys who have already been through it, that is.

Khayrattee's questions to Philip include things like:

  • What motivated you to start using Magento & when did your journey start?
  • Can you briefly give us an idea of what a Magento Certification is about & what it tries to achieve?
  • Could you help us differentiate between the three available Magento certification and which one most important to have?
  • Did you buy any learning material from Magento, how useful and critical were they? Would you have passed your exams without them?
  • Is a Zend Certification important before getting MDC? Is there any relevance?
  • Is you are good with Magento, does it mean you are equally good with Zend Framework?

Check out the full interview for the answers to these and more great questions.

tagged: philipjackson community interview magento certification

Link: http://7php.com/magento-certification-advice-phillip-jackson/

Allan MacGregor:
Magento and HHVM
Feb 18, 2014 @ 09:12:59

Allan MacGregor has a new post sharing some of his research into getting Magento working on the HHVM (the HipHop VM) and some of the benchmarks of the results.

Magento is (in)famous for its performance, specially when scaling to a large numbers products, transactions or even catalog rules, seasoned Magento developers have probably hit at least one of this performance bottle necks more than once. [...] And while all the optimizations help, in the end there is a major performance bottleneck that is not as easily surpassed and that is PHP performance, since PHP is an interpreted language there is price to pay in terms of speed of execution and overall performance.

He introduces the HHVM briefly for those not familiar with it and some of the work already in progress to make Magento cooperate. He walks you though a complete installation of both the HHVM, cloning it from GitHub, and configuring it with the settings needed for Magento to run correctly. Once the HHVM instance is started, he runs some tests with siege comparing the results from the built-in PHP web server versus the HHVM install.

tagged: magento hhvm hiphop installation tutorial configuration

Link: http://coderoncode.com/2014/02/17/magento-hhvm.html

Kevin Schroeder:
How much memory does Magento use?
Dec 10, 2013 @ 10:42:23

Kevin Schroeder was asked recently (as a part of a training class) about the amount of memory Magento actually uses during its execution. Magento is a widely-used e-commerce platform built in PHP.

Now, I know what you’re supposed to set it at, but I’ve never measured actual usage. So I gave some bullcrap answer about how it really depends on a bunch of things and that I really shouldn’t give a precise answer. But the individual persisted and I was forced to put my tail between my legs and admit that I didn’t know. So I promised that I would take a look and here are my results.

He briefly mentions how he tested the memory usage of the code overall by adding an event to several spots in the application and using memory_get_usage. Using the sample Magento data he worked his way through the site and tracked the events/memory usage on the various page of the site including:

  • Main category page
  • Category page with images
  • Simple product page
  • Add to Cart

Each of these has a graph showing the memory usage at each stage. Additionally, he's graphed them all together to compare the overall memory consumption.He finishes off the post with a few summary items and conclusions from his results.

tagged: magento memory usage consumption graph

Link: http://www.eschrade.com/page/how-much-memory-does-magento-use/

PHPBuilder.com:
Debugging Your Magento E-Commerce Applications in PHP
May 24, 2012 @ 11:11:59

On PHPBuilder.com there's a recent post looking at debugging Magento applications with some of the built-in tools the platform makes available.

Magento is the world's most popular open source e-commerce platform, relied upon by countless Fortune 500 and small business alike for selling goods and services of all types. [...] But with Magento's considerable power comes a great deal of complexity [but] it can be incredibly difficult to even identify the origin of an error let alone resolve it. You can however dramatically improve your productivity as a Magento developer by taking advantage of a few key debugging features.

They recommend using four tools built into the platform - the developer mode, logging, template path hints and viewing the raw SQL queries. They also recommend using a few other tools like FireBug and the features of Eclipse to help with code formatting and completion.

tagged: ecommerce application debug magento tools platform

Link: