本文整理汇总了PHP中Mage::headersSentThrowsException方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::headersSentThrowsException方法的具体用法?PHP Mage::headersSentThrowsException怎么用?PHP Mage::headersSentThrowsException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage
的用法示例。
在下文中一共展示了Mage::headersSentThrowsException方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
protected static function init($code)
{
Mage::$headersSentThrowsException = false;
$options = array();
$options['config_model'] = 'Codex_Xtest_Model_Core_Config';
$options['cache_dir'] = Mage::getBaseDir('var') . DS . 'cache' . DS . 'xtest';
Mage::reset();
Mage::app($code, 'store', $options);
if ($disableDouble = (bool) self::getArg('disable_double', false)) {
self::getConfig()->setDisableDoubles($disableDouble);
}
}
示例2:
if (!file_exists($mageFilename)) {
echo 'Mage file not found';
exit;
}
require $mageFilename;
if (!Mage::isInstalled()) {
echo 'Application is not installed yet, please complete install wizard first.';
exit;
}
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
#ini_set('display_errors', 1);
// emulate index.php entry point for correct URLs generation in API
Mage::register('custom_entry_point', true);
Mage::$headersSentThrowsException = false;
Mage::init('admin');
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_ADMINHTML, Mage_Core_Model_App_Area::PART_EVENTS);
// query parameter "type" is set by .htaccess rewrite rule
$apiAlias = Mage::app()->getRequest()->getParam('type');
// check request could be processed by API2
if (in_array($apiAlias, Mage_Api2_Model_Server::getApiTypes())) {
/** @var $server Mage_Api2_Model_Server */
$server = Mage::getSingleton('api2/server');
$server->run();
} else {
/* @var $server Mage_Api_Model_Server */
$server = Mage::getSingleton('api/server');
$adapterCode = $server->getAdapterCodeByAlias($apiAlias);
// if no adapters found in aliases - find it by default, by code
示例3: _initTaxAndCurrency
protected function _initTaxAndCurrency($paramsArray)
{
// Order tax percent
// -------------------------------------
$this->_taxPercent = $paramsArray['taxPercent'];
// -------------------------------------
// Order tax amount
// -------------------------------------
$this->_taxAmount = $paramsArray['taxAmount'];
// -------------------------------------
// Has tax on shipping
// -------------------------------------
$this->_taxIncludesShipping = (bool) (int) $paramsArray['taxIncludesShipping'];
// -------------------------------------
// Hack for cron
// -------------------------------------
$tempHeadersSentThrowsException = Mage::$headersSentThrowsException;
Mage::$headersSentThrowsException = false;
// -------------------------------------
// Set store current currency
// -------------------------------------
$this->_quote->getStore()->setCurrentCurrencyCode($this->_orderCurrencyCode);
// -------------------------------------
// Hack for cron
// -------------------------------------
Mage::$headersSentThrowsException = $tempHeadersSentThrowsException;
// -------------------------------------
}
示例4: initialize
/**
* Initialize an already installed Magento application
*/
public function initialize()
{
Mage::setIsDeveloperMode($this->_isDeveloperMode);
Mage_Core_Utility_Theme::registerDesignMock();
Mage::$headersSentThrowsException = false;
Mage::app('', 'store', $this->_options);
}
示例5: initialize
/**
* Initialize an already installed Magento application
*/
public function initialize()
{
$resource = Mage::registry('_singleton/Mage_Core_Model_Resource');
$this->_resetApp();
if ($resource) {
Mage::register('_singleton/Mage_Core_Model_Resource', $resource);
}
Mage::setIsDeveloperMode($this->_developerMode);
Mage::$headersSentThrowsException = false;
Mage::app('', 'store', $this->_options);
}
示例6: setUp
public function setUp()
{
parent::setUp();
Mage::$headersSentThrowsException = false;
}
示例7: _doDispatch
protected function _doDispatch(Codex_Xtest_Model_Core_Controller_Request_Http $request, $postData = null)
{
Mage::app()->getStore()->setConfig('web/session/use_frontend_sid', true);
if ($postData) {
$request->setMethod(self::METHOD_POST);
if (!isset($postData['form_key'])) {
$postData['form_key'] = Mage::getSingleton('core/session')->getFormKey();
}
$request->setPost($postData);
}
Mage::$headersSentThrowsException = false;
Mage::app()->setRequest($request);
$dispatcher = new Codex_Xtest_Model_Core_Controller_Varien_Front();
$dispatcher->setRouter(Mage::app()->getFrontController()->getRouters());
$dispatcher->dispatch();
foreach ($dispatcher->getResponse()->getHeaders() as $header) {
if ($header['value'] == '404 Not Found') {
Mage::throwException('404');
}
}
}