1

i'm trying to get the base URL within Enterprise_PageCache_Model_Processor (line 206)-- however, i'm running into the above error. Any work around that doesn't involve hardcoding the url directly?

$homepage = Mage::getBaseUrl();

above is what is causing the error.

2 Answers 2

1

Whilst I've not tried accessing getBaseUrl() - remember that FPC only instantiates a minimum amount of models (that's where the performance advantage comes from). You can't access the entire Magento god class from an FPC instantiated model.

1
  • so I'd essentially have to hardcore our base URL then, right? Commented Jul 9, 2015 at 18:02
1

First of all, you should look at getBaseUrl() definition which in app\Mage.php.

public static function getBaseUrl($type = Mage_Core_Model_Store::URL_TYPE_LINK, $secure = null)
    {
        return self::app()->getStore()->getBaseUrl($type, $secure);
    }

That means it returns site URL of your site. So first thing that you should check is whether base URL is set in backend ( Admin > System > Configuration > WebSite > Secure/Unsecure -> Base url )

And then follow this link. Amit has explained it very well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.