startEnvironmentEmulation($storeIdToEmulate); try { // .... logic which have to be in store env proceed } catch (Exception $e) { Mage::logException($e); // do not forget stop emulation if some error happens $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); throw $e; } // at the and of our logic - stop emulation $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);