Greg Aker

Entries Tagged with: ExpressionEngine

Drama...sigh

Be a part of the solution

Filed in: Blobbing, ExpressionEngine

January 9, 2012

Ah, it's winter. (side note: I seriously need to get the winter theme up and going on my site.) It's that time of year where the ExpressionEngine user-base starts to get restless. Oh, who am I kidding, it can happen at any time of year. So a recent comment on Kenny's article over at The Nerdary got me thinking, and I decided to dust off my long ignored blog.

I don't think users of ExpressionEngine have any clue what it's like to be a developer at EllisLab, what it entails, or what the fuck they ...

Read More

Know what ORMs and Query Builders do!

Filed in: Django, ExpressionEngine, CodeIgniter

September 2, 2011

ORMs and Query Builders such as the Django ORM and CodeIgniter Active Record classes are great time savers. But you can get yourself into performance trouble if you're not paying attention to what these are doing behind the scenes. I think the biggest mistake people make is they use tools like this as crutches for not understanding how to write simple SQL statements. Don't fall into this group! If you're in it, work hard to get out!

I'll show a couple of examples from both to illustrate how you can give your applications a performance boost ...

Read More

var_dump($this) in EE/CI with no recursion

Filed in: PHP, ExpressionEngine, CodeIgniter

August 18, 2011

Here's a quick little tip for all you EE addon developers out there. I've seen some people moaning on Twitter about how a var_dump() can be hard on the browser due to the recursion in the CodeIgniter singleton. So check how I like to roll in my CI libraries/EE addons.

<?php

class Foo {

    protected $_foo;

    public function __construct()
    {
        $this->_foo = $this->config->item('something');
    }
}

Look maw, no $this->CI

Did you know you you can do this in a CodeIgniter library or an ExpressionEngine mcp/mod/extension/plugin/accessory file? It's pretty easy to accomplish, and ...

Read More

Showing PHP Memory Usage through your Template

Filed in: Performance, PHP, ExpressionEngine

June 18, 2011

Ever been deep in troubleshooting performance issues in your ExpressionEngine site and wondered what kind of memory is a certain plugin/weblog tag, etc is taking up? Unless you're holding out from blogging about it, there's absolutely no way I'm aware of that you're getting that info from shell on the server. So, here's a quick and dirty hack to EE's template parser that will show you this info.

Pop open system/expressionengine/libraries/Template.php and look for:

<?php

function log_item($str)

Now, a quick addition in there and you're good to ...

Read More

Session Cache in ExpressionEngine

Filed in: PHP, ExpressionEngine, tutorial

June 14, 2011

I think the session cache may quite possibly be one of the more under used tools in the third-party ExpressionEngine developers toolbox. The speed/performance increases from strategically caching items in this can be substantial. As with anything you do while developing your addon, benchmarking needs to be done every step of the way to ensure you aren't overdoing it and actually causing issues. I want to illustrate how adding something to the session cache can give a nice performance boost.

What is the session cache?

First, see the docs.

If you're a developer and haven't had ...

Read More

DB Results in ExpressionEngine and CodeIgniter

Filed in: ExpressionEngine, CodeIgniter

June 9, 2011

I learned PHP by forcing myself to try to create ExpressionEngine addons. I studied the 1.x code. I poured over the CodeIgniter core, trying to figure out how the heck it worked. One thing that confused me was how the heck do I get a single result from an active record query! If you're in this boat, I hope this might help clear it up for you a bit.

In ExpressionEngine 2.x, unless you're doing something extremely complex, using the CodeIgniter Active Record class is the way to go.

For instance, if we want to do ...

Read More

How about a soft launch on a Friday?

Check Out Pkg.io!

Filed in: Blobbing, ExpressionEngine

April 22, 2011

At SXSW this year, Marcus Neto and I wanted to build something. Our fearless leader Leslie Camacho bet us we couldn't. Well, it was on like donkey kong. We enlisted the help of Pascal, started brainstorming, and came up with pkg.io.

At this time, it's an addon skeleton maker for ExpressionEngine developers. What we're most happy with, is someone with no knowledge of PHP will be able to make an accessory to use on their client sites. We think we have some fun things in store, but wanted to get something out now.

Since we code ...

Read More

Let's build an ExpressionEngine Module!

Control Panel Page (mcp file) and model. Part One

Filed in: PHP, ExpressionEngine, tutorial

March 16, 2011

  1. Project Setup and Module Installation
  2. Control Panel Page (mcp file) and model. Part One
  3. Control Panel Page (mcp file) and model. Part Two
  4. Front End Template Tag

I decided to break the control panel portion into two parts, so this will now be a four part series. First, we're going to build the form to submit a short link. This will include a model, view and controller (mcp file).

So, let's start by setting up the base for the module control panel file (mcp.shortee.php). Open that up in your editor, and let's get to work ...

Read More

Let's build an ExpressionEngine Module!

Intro & Install/Update File

Filed in: PHP, ExpressionEngine, tutorial

March 13, 2011

  1. Project Setup and Module Installation
  2. Control Panel Page (mcp file) and model. Part One
  3. Control Panel Page (mcp file) and model. Part Two
  4. Front End Template Tag

I think I'm a bit different than most in how I view the ease in which to build the different types of ExpressionEngine addons, but I definitely think that in most cases modules are not a heck of a lot more difficult than Plugins. Personally, I find Extensions the most difficult as you have to develop with a keen eye to ensure your extension is playing nice with the rest of the ...

Read More

Constructor-structor, what's your function?

Filed in: ExpressionEngine, CodeIgniter

March 10, 2011

I'd like to set the record straight on the usage of class constructors in CodeIgniter and ExpressionEngine apps/addons. I have seen EE-addons and CI code examples using them where they are not necessary. To illustrate this point and make things a bit more clear, I removed the class constructor from the CodeIgniter 'welcome' controller last night. Since your controllers in CI extend CI_Controller, you automatically inherit all the code that is contained in CI_Controller::__construct().

So for instance, if you have a controller like:

<?php

class Foobar extends CI_Controller {

    public function index()
    {
        $this->load->view('foobar');
    }
}

or a ...

Read More