Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Defining function ee() causes errors when in config.php

Status Resolved
Add-on / Version Publisher
Severity Critical
EE Version 24

Matthew R. Weinberg

Aug 08, 2013

We’re running 1.0.2 so feel free to close this if it’s fixed in the newer release, but after bringing Publisher to our production host (this didn’t happen on staging), the whole site—CP and front-end—would totally white screen. Even with debugging on we didn’t get anything useful. We tracked it down to:

function ee()
{
    static $EE;
    if ( ! $EE) $EE = get_instance();
    return $EE;
}

which is in publisher/config.php. We moved that out of your config.php and into the extension constructor, and all is working now. We’re on PHP 5.3.2.

#1

BoldMinded (Brian)

That is really strange. Sorry it caused you trouble. That has been in place for several versions now without any known issues. I’ll look into moving it into the ext file for the next release.

#2

BoldMinded (Brian)

What version of EE are you using?

#3

BoldMinded (Brian)

If you’re using 2.6+ then you can just remove it. Its only for 2.5 compatibility.

#4

Matthew R. Weinberg

Thanks! We’re using 2.5.5 so need it. Weirdly this didn’t cause us a problem on our staging or local, just our production EngineHosting box (even though they’re all PHP 5.3). EH couldn’t identify an issue and I was able to fix it with just that change regardless.

#5

Brian Litzinger

I’m going to try to keep it in config.php, but I added an APP_VER check so it only tries to create the function in less than 2.6. This is what I changed it to if you want to try it in config again.

if (version_compare(APP_VER, '2.6', '<') && !function_exists('ee'))
{
    function ee()
    {
        static $EE;
        if ( ! $EE) $EE = get_instance();
        return $EE;
    }
}
#6

Brian Litzinger

D’oh, well in your case you are in less than 2.6, so that won’t change anything for you.

Login to reply