本文整理汇总了PHP中mage::logException方法的典型用法代码示例。如果您正苦于以下问题:PHP mage::logException方法的具体用法?PHP mage::logException怎么用?PHP mage::logException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage
的用法示例。
在下文中一共展示了mage::logException方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: controller_action_predispatch
/**
* Hook to record all fron controller events
* @param Varien_Event_Observer $observer
*/
public function controller_action_predispatch(Varien_Event_Observer $observer)
{
try {
if (extension_loaded('newrelic')) {
$controllerAction = $observer->getControllerAction();
$request = $controllerAction->getRequest();
$controllerName = explode("_", $request->getControllerName());
if (Mage::getStoreConfig('newrelic/settings/ignore_admin_routes') && $request->getRouteName() == 'adminhtml' || $request->getModuleName() == 'admin' || in_array('adminhtml', $controllerName)) {
Mage::Helper('newrelic')->setAppName(false);
newrelic_ignore_transaction();
newrelic_ignore_apdex();
return $this;
}
if (mage::helper('newrelic')->ignoreModule($request->getModuleName()) === true) {
Mage::Helper('newrelic')->setAppName(false);
newrelic_ignore_transaction();
newrelic_ignore_apdex();
return $this;
}
if (Mage::getStoreConfig('newrelic/settings/named_transactions')) {
$route = $request->getRouteName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
if (Mage::getStoreConfig('newrelic/settings/add_module_to_named_transactions')) {
$route .= ' (module: ' . $request->getModuleName() . ')';
}
newrelic_name_transaction($route);
Mage::Helper('newrelic')->setAppName(true);
return $this;
}
}
} catch (Exception $e) {
mage::logException($e);
}
}
示例2: changeQty
public function changeQty($observer)
{
$event = $observer->getEvent();
// $observer->getData();
// $quoteItem = $observer->getQuoteItem();
$model = Mage::getModel('itdelight_first/quantity');
$model->getCollection();
// Zend_Debug::dump($observer);
// die;
// $observer->getData('cart')->getData();
// $observer->getData('cart')->getData('quote')->setData(array('cart_qty'=>'20'));
// $_POST['qty'] = "4";
// Zend_Debug::dump($_POST);
// $quoteItem = $observer->getEvent()->getQuoteItem()->setQty('15');
try {
$quoteItem = $observer->getQuoteItem();
if (is_null($quoteItem->getParentItem())) {
$qty_my = $quoteItem->getQty();
$qty = $qty_my * 2;
$quoteItem->setQty($qty);
$quoteItem->setQtyToAdd($qty);
} else {
$qty_my = $quoteItem->getParentItem()->getQty();
$qty = $qty_my * 2;
$quoteItem->getParentItem()->setQty($qty);
$quoteItem->getParentItem()->setQtyToAdd($qty);
}
} catch (Exception $e) {
mage::logException($e);
}
}
示例3: __construct
public function __construct()
{
try {
$this->setDefaults();
} catch (Mage_Core_Model_Store_Exception $e) {
// cannot determine default store id (??)
// try and load by default store id
$this->setDefaults(0);
} catch (Exception $e) {
$this->_enabled = false;
mage::logException($e);
}
if (empty($this->_account_Id) || empty($this->_api_key) || empty($this->_data_key)) {
$this->_enabled = false;
}
}
示例4: clearCache
/**
* Clear the carousel cache daily.
* This will allow the carousels to rebuild taking into account any changes on scheduled items in the carousel.
* The next time it is viewed, a carousel will load the latest (in scheduled) items for display
*/
public static function clearCache()
{
try {
// use global tag, whuch will clear all carousels
$tag = array(Doghouse_Carousel_Block_Carousel::CACHE_GROUP);
mage::helper('dhcarousel')->clearCache($tag);
// pageCache only listens to adminhtml requests to clear, so force it to clear
if (Mage::app()->useCache('full_page')) {
$fpc = mage::getModel('enterprise_pagecache/observer');
if (is_object($fpc)) {
$fpc->cleanCache();
}
}
} catch (Exception $e) {
mage::logException($e);
}
}
示例5: __construct
public function __construct()
{
$this->_userAgentString .= '/' . $this->getExtensionVersion();
$this->_userAgentString .= ' (https://github.com/ProxiBlue/NewRelic)';
try {
$this->setDefaults();
} catch (Mage_Core_Model_Store_Exception $e) {
// cannot determine default store id (??)
// try and load by default store id
$this->setDefaults(0);
} catch (Exception $e) {
$this->_enabled = false;
mage::logException($e);
}
if (empty($this->_account_Id) || empty($this->_api_key) || empty($this->_data_key)) {
$this->_enabled = false;
}
}