Last active
September 18, 2015 07:55
-
-
Save dwickstrom/6b184b464883ab5a1923 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MageEnvironmentTrait | |
{ | |
public function setEnvironment($env = null) | |
{ | |
if (!$env) { | |
$env = Mage_Core_Model_App_Area::AREA_FRONTEND; | |
} | |
Mage::getSingleton('core/session', array('name' => $env)); | |
Mage::getConfig()->init(); | |
Mage::getConfig()->loadEventObservers($env); | |
Mage::app()->addEventArea($env); | |
Mage::app()->loadArea($env); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment