当前位置: 首页>>代码示例>>PHP>>正文


PHP mage::logException方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:Bobspadger,项目名称:NewRelic,代码行数:37,代码来源:Observer.php

示例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);
     }
 }
开发者ID:AleksLi,项目名称:magento_school,代码行数:31,代码来源:Observer.php

示例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;
     }
 }
开发者ID:Bobspadger,项目名称:NewRelic,代码行数:16,代码来源:Abstract.php

示例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);
     }
 }
开发者ID:rob3000,项目名称:Doghouse_Carousel,代码行数:22,代码来源:Cron.php

示例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;
     }
 }
开发者ID:c3limited,项目名称:NewRelic,代码行数:18,代码来源:Abstract.php


注:本文中的mage::logException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。