Published by Mijingo

All entries filed under “Development Tools”

ExpressionEngine Command Line Interface?

If anyone would take a stab at a CLI for ExpressionEngine, it would be Rob Sanchez.

And he did.

The CLI right now is limited in functionality (empty cache, install add-ons) but Rob is asking for pull requests with additional commands.

Have something you want to see added? Code it and then submit a pull request to the Github project.

Thank you, Rob. This is a great addition.

Posted on Aug 26, 2014 by Ryan Irelan

Filed Under: Development Tools

ExpressionEngine Partials Talk Slides

John D. Wells posted the slides from his GeeUp talk called “Partials: A DRY template pattern. Now part of EE core.

That about says it all. John gives an informative walk-thru of how partials will help you. Even without seeing John give the talk, the slides are very helpful.

The addition of real layout support in EE is a huge step forward. No more hack arounds needed. And, layouts even support dynamic variables that you can set similar to embed variables. But better because it’s not embeds.

The update to my ExpressionEngine training course (coming out tomorrow) covers layouts and it was a joy to be able to teach that instead of the old embed way, which was easily abused at the expense of the performance of your website.

Page through John’s slides to learn more about layouts

Posted on Jul 07, 2014 by Ryan Irelan

Filed Under: Development Tools, ExpressionEngine 2

EE StackExchange & Alfred 1

This is only useful to the subset of ya’ll who use Alfred 2, a nice quick launcher utility for OS X.

It’s an Alfred workflow that makes it easy to search EE StackExchange and find what you need (hopefully a solution to a problem!).

The workflow was created by EllisLab and shared on their blog.

While we’re talking about EE StackExchange. If you have a moment, hop over to the site and answer any questions you can!

Posted on May 27, 2014 by Ryan Irelan

Filed Under: Community, Development Tools

ExpressionEngine DB Trace Module

Has anyone used this?

The general concept is to trace your local db changes and store them into a release file. Release files can be deployed through FTP/GIT/SVN/Etc, after deploy you can do an install of the release, pushing all your db changes.

(via Codeignitee)

Posted on Mar 18, 2014 by Ryan Irelan

Filed Under: Development Tools

Full List of EE Config Overrides

A new addition to the EE documentation is this full list of System Configuration Overrides. The overrides–in the past documented in the wiki and other places–allow you to override default values or values set through the control panel and saved in the database right in your config file. This is handy if you need those values to differ between environments (local, dev, production).

From former EllisLab employee Kevin Smith:

Posted on Mar 16, 2014 by Ryan Irelan

Filed Under: Development Tools, ExpressionEngine 2

Yeoman EE Add-on Generator

Yeoman is a web app development workflow that makes it easy to generate scaffolds for dozens of web development technologies.

Rob Sanchez made a Yeoman generator for ExpressionEngine add-ons (a fork of one created for modules) that makes it easy to spin up a new add-on package by just answering some questions.

All it takes is running:

yo ee-addon

to generate a new add-on shell.

Posted on Mar 11, 2014 by Ryan Irelan

Filed Under: Development Tools, EE Add-ons

ExpressionEngine Setup Tips

Bluedreamer writes:

As any EE pro will know, setting up an ExpressionEngine site can involve going back and forth to the same old settings several times. All this takes time and money, but you can speed up the initial process by following a few simple steps which could save you an hour or two’s worth of faffing about!

Just like it says on the tin.

Posted on Oct 07, 2013 by Ryan Irelan

Filed Under: Development Tools

Dploy Launches

Today Wildbit, the company behind Beanstalk, launched, which handles continous deployment for Github, Bitbucket, and private repositories.

Beanstalk is my favorite repository hosting tools because of its excellent deployment tools. But sometimes I want to host my code elsewhere but still take advantage of those makes that much easier now.

It $29/mo (free for open source) and can deploy to one more servers at a time.

Posted on Sep 17, 2013 by Ryan Irelan

Filed Under: Development Tools

EE to Support New Relic

In an upcoming release ExpressionEngine will support New Relic, an application monitoring service.

New Relic gives you all sorts of juicy data about your website and web application (in this case it would be ExpressionEngine). It can also do PHP application monitoring and measure response time, throughput and other server information.

From the EllisLab blog post announcing the upcoming support:

ExpressionEngine will soon be bringing out-of-the-box compatibility with the popular application performance monitoring service New Relic. We’ve been using the service ourselves and find it incredibly useful and oftentimes enlightening. With no need to install a module or add any tags, ExpressionEngine will automatically detect if New Relic is enabled in your PHP environment and provide you with a wealth of useful information.

If you’re unfamiliar, New Relic gives you a look into all aspects of the full stack of your site’s performance, particularly at the transaction level.

Do you already use New Relic and want to give input into the features of the New Relic API that ExpressionEngine will support? EllisLab wants your input and feedback. See the blog post for more details.

Posted on Jul 01, 2013 by Ryan Irelan

Filed Under: Development Tools, EllisLab, ExpressionEngine 2

EE Database Migrations with Logged Queries

An interesting approach to EE site deployment by Krasimir Tsonev where he logs out all queries required to make changes to an EE site (add channels, fields, etc) and the re-runs those queries in another environment.

It’s a somewhat manual, requires changing core files but also possibly a workable database migration for ExpressionEngine.

I have several servers and every one of them has its own database. There are changes in my local database which I have to transfer to the others. I don’t need to export/import the whole database. I need only the latest changes which I’ve just made. Ok so … if I inject some code just before to send something to the mysql I’ll be able to log all the queries. Doing this I’ll have the exact requests to the database and will be able to execute them on the other machines.

Has anyone else tried something like this?

Deploying ExpressionEngine based site

Posted on Jun 26, 2013 by Ryan Irelan

Filed Under: Development Tools

From the Archives: How to Use Third Party Email Services

Earlier this year Jason Siffring posted a great article on how to use a transactional email service for ExpressionEngine emails. I was working on improving mail over Mijingo and needed to refer to the article.

Jason even gives you a great comparison of third-party email services. Also, note the Escort add-on that will make it easier to interface with the service APIs.

Has a client ever said to you, “Why didn’t I get that reset password email?” Have you ever had to wait patiently for like ten minutes to get a new member activation email? Ever lose sleep wondering if your contact form is really working? If so, let me introduce you to the wonderful world of transactional email delivery services.

Learn about transactional email services.

Posted on Jun 23, 2013 by Ryan Irelan

Filed Under: Development Tools

Comparing Technical Debt

No matter which solution you choose, beware of the technical debt you incur along the way. Sam Hernandez says it well:

Posted on Jun 17, 2013 by Ryan Irelan

Filed Under: Development Tools, Life as a Web Professional

EE Add-on Builder

Sample EE Insider Extension

Luke Wilkins (he’s a developer at Vector Media Group, one of our amazing site advertisers) built a Sublime Text plugin that makes it easy to build ExpressionEngine add-on starter files.

The Sublime Text package walks you through inputting the information needed for creating the add-on type you choose and when you’re done you have the base add-on package built for you. Pretty cool stuff.

After choosing your Add-On type, you will be asked for the relevant pieces of data to get things set up. From there it’s just a matter of adding your logic to the generated Add-On! You can refer to the Expression Engine Docs for more details on Add-On development.

In the event that you wish to add a new Add-On type to an existing Add-On you’ve created (for example, you’ve created a module and now want to add an extension), simply go through the process again with the same Package Name and path and the plugin will allow you to automatically merge that in.

It’s available on Github or you can install it right in Sublime Text.

Posted on May 23, 2013 by Ryan Irelan

Filed Under: Development Tools, EE Add-ons

EE 2.6 Supports Relative Dates, Easier DST

EE 2.6 has some improvements with how it handles dates and time.

First, there’s no more messing with choosing whether or not you’re observing Daylight Savings Time. EllisLab says:

With the new PHP version requirements for ExpressionEngine, we were able to take advantage of more modern date handling techniques to eliminate the DST setting all together. All you will have to do is choose your timezone and we’ll take care of the rest.

Because of the new PHP version requirement we also get an enhancements in the Date field that allows relative dates to be used. Things like: “noon tomorrow” or “last day of january.”

Read all about it in the EllisLab blog post.

Posted on May 01, 2013 by Ryan Irelan

Filed Under: Development Tools, EllisLab, ExpressionEngine 2

The Key to ExpressionEngine Performance

Eric Lamb is the developer of professional and enterprise grade ExpressionEngine add-ons. Founded in 2009 Eric’s company mithra62 aims to be a leader in ExpressionEngine add-on development and has a reputation for stability, usefulness, and being highly configurable. Check out Eric’s popular ExpressionEngine add-on Backup Pro.

Imagine you were to build a house. After all the years of building web sites and being a slave to “the man” the pay day has finally come; you’ve sold out and you’re finally gonna hire a contractor to design and build you the house of your dreams (or your wife’s/husband’s/whatever’s dreams). You want to get everything; all the bells and whistles anyone could ever want in a house. Doors and windows and all the other house “things”. No expense is spared and it’s gonna be a marvel of engineering to be proud of.

And then you decide to build it on top of a swamp that floods every year with intermittent droughts, earthquakes, tornadoes, and hurricanes, and wasps and mosquitos. And bed bugs. And that really gross smell tanneries have hanging around. That too.

This is what a lot of web developers do. It’s really weird when you think about it too. They spend so much time putting together their project, crafting the perfect solution to whatever problem they’re trying to solve, and then just throw it up onto any old web server that’s not equipped for it. A website needs a literal solid foundation. A home to live and work that is as specific to it’s needs as possible. Yet so many web developers just throw the site up on a host and consider the project done.

The big problem is the fallacy that “all you need is PHP” a lot of clients (and devs) have in their mind. It’s not really the client’s fault though; how could they understand the nuance of using a tool like ExpressionEngine, that’s built with a PHP framework like CodeIgniter? Nope, the problem lies with us, the web developers. A lot of us just don’t know what the hell’s going on with the server.

It’s the FRAMEWORK Keeping You Down

PHP, by itself, is pretty lightweight. If you want to display a simple PHP script that connects to a database, compiles information about something, and then display the HTML, using native inline procedural PHP is pretty efficient. It’s also time consuming, likely to be insecure, tough to maintain while keeping ones joy and sanity, and just an all around pain in the ass. So, smart developers use frameworks like CodeIgniter (the framework used for ExpressionEngine).

As a programmer, frameworks are great. They’re pretty much the antithesis of the above. As ExpressionEngine is to building a website, frameworks are to building tools like ExpressionEngine. Most frameworks take security seriously, are easy(ish) to maintain, and are a pleasure to work with (or at least make an attempt to not be an absolute pain). But it usually comes at a cost; performance. It’s a given rule that any time you use a framework you’re going to need more server resources made available to your program.

The biggest reason for this is because frameworks just have a lot of PHP files that do a lot of complicated stuff behind the scenes. Pretty much everything is abstracted and object oriented and polymorphic and buzzword, buzzword, buzzword. It’s a lot of processing. And when you take into account that PHP is an interpreted language that has to compile the PHP on every request it starts to add up.

Introducing the PHP Opcode Cache

To get around dealing with the large number of PHP scripts a framework all but requires a PHP Opcode Cache (or PHP Accelerator). An Opcode Cache is a PHP module that takes your PHP scripts and caches the compiled bytecode so later requests don’t have that overhead. For those that don’t what that means, suffice it to say that using a PHP Opcode Cache will improve your PHP performance by, in my experience, anywhere from 60 to 90%. This is serious improvement I’m talking about. More than that, it’s also the most cost effective in terms of time investment and overall implementation pain.

For example, the process of getting setup is ridiculously simple using the Alternative PHP Cache (APC). On my new Ubuntu VM, it was literally 1 command:

aptitude install php-apc

That’s it. I run that single command on my server and all my ExpressionEngine sites are running at an average of 4MB on the homepages and at a tenth of a second request time using APC (down from 25MB and 1.5 seconds).

In terms of PHP Opcode Caches, I have 3 personal favorites (though there are lots of others): APC (obviously), eAccelerator, and XCache.


APC is the one I’m currently using for my server. Not because it’s the best Opcode Cache out there but because, as the above demonstrates, it’s crazy simple to get up and running (I’m lazy) and my current needs don’t require more than the “good enough” it offers.

The really nice thing about APC (outside of crazy simple setup) is the maturity. It used to be implemented by Facebook (who also contributed to the project) and has been endorsed by the the people behind Zend. In fact, APC is supposed to be integrated into the core of PHP no later than 6.0 (though I think they’ve moved this to 5.5 though I could be wrong).


eAccelerator has been around for about 9 years now and is my go to when shaving a couple extra MBs of memory matters. The performance return on eAccelerator is really impressive and in my experience it gets no better. eAccelerator is also the Opcode Cache use by cPanel and WHM managed servers (by default) which I think says a lot.

The big downside to eAccelerator is that it’s sort of a pain in the ass to get setup on the command line though. It requires building things custom to the platform and it also needs to be rebuilt every time you update PHP. Definitely an advanced option.


XCache is a really nice Opcode Cache in my experience. For Windows hosting it’s an absolute must and I’ve used it in production on quite a few projects. Setup is simple and straightforward and I have yet to experience any issues on installation. The performance gains are similar to APC though it does depend on what you’re doing and how it’s being done (both work differently so some things work better on one and not the other).

I have had issues with it though. I’m not entirely sure what the root cause of the issue was/is but with Zend Framework based sites XCache didn’t work out quite so well. It’s been a couple years since I’ve used it so this may be a non issue.

Additional Considerations

There are lots of other techniques you can use to improve the performance of your PHP site outside of an Opcode Cache but none can give you the return quite like it. Adding things like MySQL query caching, or memcached, or a number of other things can help improve things further but you’ll never get the return like on an Opcode Cache.

One thing to keep in mind is that an Opcode Cache can also become a crutch. It’s crucial that one not be used during development. If what you’re building needs an Opcode Cache in order to function you’ve likely made some serious errors elsewhere. Using an Opcode Cache during development will hide this from you and possibly hurt things later.

For production though, an Opcode Cache is an absolute requirement. If you have a dedicated server you’re sort of on your own in terms of implementation. Google is your friend. Things like “Ubuntu install eAccelerator” will do you good (or whatever OS you’re using). For managed hosting though, just send an email to your host and ask them to install the Opcode Cache you want. You’ll be seriously amazed at the speeds and footprint of your sites.

Eric Lamb is the developer of professional and enterprise grade ExpressionEngine add-ons. Founded in 2009 Eric’s company mithra62 aims to be a leader in ExpressionEngine add-on development and has a reputation for stability, usefulness, and being highly configurable. Check out Eric’s popular ExpressionEngine add-on Backup Pro.

Posted on Apr 30, 2013 by Eric Lamb

Filed Under: Development Tools, Site Performance