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

Kevin Schroeder:
Configuring MySQL SSL in Magento
Sep 28, 2015 @ 09:24:34

Kevin Schroeder has a quick post to his site showing the Magento users out there how to configure the SSL connection to their MySQL database backend.

’ve been asked a few times now if there is a way to use encrypted MySQL connections in Magento. [...] The answer, to my surprise, is that there is no way of doing it out of the box.

[...] All database configurations are stored in the local.xml file and the XML specification does not allow numbers for XML node names. So no matter how you try to slice it it looks like getting the SSL settings into the Magento adapter will not work without a code change. The Internet seems to confirm this. But that doesn’t mean that it can’t be done. So I wrote a quick Magento adapter that allows you to pass in the constant values.

He walks you through the process of getting the adapter installed, configuring MySQL to allow for the SSL connections and the configuration change to make. He includes the XML you'll need to update, including the addition of a secure_driver_options to the XML to provide the necessary SSL connection information.

tagged: magento mysql adapter ssl connection configure database

Link: http://www.eschrade.com/page/configuring-mysql-ssl-in-magento/

Barry vd. Heuvel:
Using local repositories to easily install private Magento extensions with Compose
Sep 22, 2015 @ 09:02:26

In a post over on Medium.com Barry vd. Heuvel shows you how to use a recently added feature of Composer, the ability to use local repositories, to install Magento extensions quickly and easily.

I’m a fan of using Composer (in- and outside Magento), so I like to use that option. This works great for free packages listed on Magento connect or Firegento Packages, because you can just require the packages and run composer update. [...] This is all great for public packages, which are download through the Firegento repository. But what about private packages? Ideally we could also use Composer for the packages we purchase. [...] In this blog I’d like to explain how to tackle these 2 problems, so you can keep using the Composer workflow.

He walks you through the two steps you'll need to set up the module so it can be installed via Composer: creating a mapping (package.xml) and the composer.json. For the first he recommends using the Magerun modman tool to help with this. Creating/updating thecomposer.json file to work with the extensions is relatively easy. He makes use of the "path repositories" functionality to points the package at the "extensions/" directory using wildcards in the path name to allow for inclusion of all extensions without having to list each one (see this PR). Finally, to help make the process a bit more clear, he walks through a full example using the Amasty module.

tagged: magento composer install local repository extension packagexml tutorial

Link: https://medium.com/@barryvdh/using-local-repositories-to-easily-install-private-magento-extensions-with-composer-7eb966dec23e

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/

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

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/

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