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


PHP Mage::getIsDeveloperMode方法代码示例

本文整理汇总了PHP中Mage::getIsDeveloperMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::getIsDeveloperMode方法的具体用法?PHP Mage::getIsDeveloperMode怎么用?PHP Mage::getIsDeveloperMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage的用法示例。


在下文中一共展示了Mage::getIsDeveloperMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadPostAction

 public function uploadPostAction()
 {
     try {
         if (!isset($_FILES['template'])) {
             throw new Mage_Exception($this->__("No template file selected"));
         }
         $file = $_FILES['template'];
         if ($file['error']['file'] !== UPLOAD_ERR_OK) {
             throw new Mage_Exception($this->__("Error when uploading template (#%s)", $file['error']['file']));
         }
         $template = $this->_initTemplate();
         $template->loadFromFile($file['tmp_name']['file']);
         $template->save();
         if (version_compare($template->getVersion(), Mage::helper('mzax_emarketing')->getVersion()) < 0) {
             $this->_getSession()->addWarning($this->__("The template you just uploaded was made with version %s, you only have version %s of Mzax Emarketing. This might cause an issue."));
         }
         $this->_getSession()->addSuccess($this->__("Template successfully uploaded."));
         $this->_redirect('*/*/edit', array('id' => $template->getId()));
         return;
     } catch (Mage_Exception $e) {
         $this->_getSession()->addError($e->getMessage());
     } catch (Exception $e) {
         if (Mage::getIsDeveloperMode()) {
             throw $e;
         }
         Mage::logException($e);
         $this->_getSession()->addError($this->__("There was an error uploading the template."));
     }
     $this->_redirect('*/*/index');
 }
开发者ID:sakibanda,项目名称:emarketing,代码行数:30,代码来源:TemplateController.php

示例2: initializeAspectKernel

 /**
  * Initializes the aspect kernel.
  *
  * @return void
  */
 public function initializeAspectKernel()
 {
     $cacheTypes = Mage::app()->useCache();
     $aspectKernel = Danslo_Aop_Aspect_Kernel::getInstance();
     $aspectKernel->init(array('debug' => Mage::getIsDeveloperMode() || empty($cacheTypes[self::AOP_CACHE_TYPE]), 'cacheDir' => $this->_getCacheDir()));
     self::$initialized = true;
 }
开发者ID:bodiski,项目名称:Danslo_Aop,代码行数:12,代码来源:Observer.php

示例3: dispatch

 public function dispatch($action)
 {
     try {
         $this->getRequest()->isGet() && !$this->getRequest()->isPost() && !$this->getRequest()->isXmlHttpRequest() && $this->updateDomainBackup();
         Mage::helper('M2ePro/Exception')->setFatalErrorHandler();
         return parent::dispatch($action);
     } catch (Exception $exception) {
         if ($this->getRequest()->getControllerName() == 'adminhtml_support') {
             exit($exception->getMessage());
         } else {
             if (Mage::getIsDeveloperMode()) {
                 throw $exception;
             } else {
                 try {
                     Mage::helper('M2ePro/Exception')->process($exception, true);
                 } catch (Exception $exceptionTemp) {
                 }
                 if (($this->getRequest()->isGet() || $this->getRequest()->isPost()) && !$this->getRequest()->isXmlHttpRequest()) {
                     $this->_getSession()->addError(Mage::helper('M2ePro/Exception')->getUserMessage($exception));
                     $this->_redirect('*/adminhtml_support/index');
                 } else {
                     exit($exception->getMessage());
                 }
             }
         }
     }
 }
开发者ID:naz-ahmed,项目名称:ndap-magento-mirror,代码行数:27,代码来源:MainController.php

示例4: _addData

 protected function _addData($data, $scope, $forceReload = false, $translationSource = null)
 {
     foreach ($data as $key => $value) {
         if ($key === $value) {
             continue;
         }
         $key = $this->_prepareDataString($key);
         $value = $this->_prepareDataString($value);
         if ($scope && isset($this->_dataScope[$key]) && !$forceReload) {
             /**
              * Checking previos value
              */
             $scopeKey = $this->_dataScope[$key] . self::SCOPE_SEPARATOR . $key;
             if (!isset($this->_data[$scopeKey])) {
                 if (isset($this->_data[$key])) {
                     $this->_data[$scopeKey] = $this->_data[$key];
                     /**
                      * Not allow use translation not related to module
                      */
                     if (Mage::getIsDeveloperMode()) {
                         unset($this->_data[$key]);
                     }
                 }
             }
             $scopeKey = $scope . self::SCOPE_SEPARATOR . $key;
             $this->_data[$scopeKey] = $value;
         } else {
             $this->_data[$key] = $value;
             $this->_dataScope[$key] = $scope;
         }
     }
     return $this;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:33,代码来源:Translation.php

示例5: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('product_id', array('header' => Mage::helper('M2ePro')->__('Product ID'), 'align' => 'right', 'width' => '100px', 'type' => 'number', 'index' => 'product_id', 'filter_index' => 'main_table.product_id', 'frame_callback' => array($this, 'callbackColumnProductId')));
     $this->addColumn('name', array('header' => Mage::helper('M2ePro')->__('Product Title / SKU'), 'align' => 'left', 'type' => 'text', 'index' => 'value', 'filter_index' => 'cpev.value', 'frame_callback' => array($this, 'callbackColumnProductTitle'), 'filter_condition_callback' => array($this, 'callbackFilterTitle')));
     $this->addColumn('stock_availability', array('header' => Mage::helper('M2ePro')->__('Stock Availability'), 'width' => '100px', 'index' => 'is_in_stock', 'filter_index' => 'cisi.is_in_stock', 'type' => 'options', 'sortable' => false, 'options' => array(1 => Mage::helper('M2ePro')->__('In Stock'), 0 => Mage::helper('M2ePro')->__('Out of Stock')), 'frame_callback' => array($this, 'callbackColumnStockAvailability')));
     $this->addColumn('ebay_item_id', array('header' => Mage::helper('M2ePro')->__('eBay Item ID'), 'align' => 'left', 'width' => '100px', 'type' => 'text', 'index' => 'item_id', 'filter_index' => 'ebit.item_id', 'frame_callback' => array($this, 'callbackColumnEbayItemId')));
     $this->addColumn('ebay_available_qty', array('header' => Mage::helper('M2ePro')->__('eBay Available QTY'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'ebay_qty_sold', 'filter' => false, 'sortable' => false, 'filter_index' => 'main_table.ebay_qty_sold', 'frame_callback' => array($this, 'callbackColumnEbayAvailableQty')));
     $this->addColumn('ebay_qty_sold', array('header' => Mage::helper('M2ePro')->__('eBay Sold QTY'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'ebay_qty_sold', 'filter_index' => 'main_table.ebay_qty_sold', 'frame_callback' => array($this, 'callbackColumnEbayQtySold')));
     if ($this->sellingFormatTemplate->isListingTypeAuction() || $this->sellingFormatTemplate->isListingTypeAttribute()) {
         $this->addColumn('ebay_start_price', array('header' => Mage::helper('M2ePro')->__('"Start" Price'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'ebay_start_price', 'filter_index' => 'main_table.ebay_start_price', 'frame_callback' => array($this, 'callbackColumnStartPrice')));
         /*$this->addColumn('ebay_reserve_price', array(
               'header'    => Mage::helper('M2ePro')->__('"Reserve" Price'),
               'align'     =>'right',
               'width'     => '50px',
               'type'      => 'number',
               'index'     => 'ebay_reserve_price',
               'filter_index' => 'main_table.ebay_reserve_price',
               'frame_callback' => array($this, 'callbackColumnReservePrice')
           ));*/
     }
     $this->addColumn('ebay_buyitnow_price', array('header' => Mage::helper('M2ePro')->__('"Buy It Now" Price'), 'align' => 'right', 'width' => '50px', 'type' => 'number', 'index' => 'ebay_buyitnow_price', 'filter_index' => 'main_table.ebay_buyitnow_price', 'frame_callback' => array($this, 'callbackColumnBuyItNowPrice')));
     $this->addColumn('status', array('header' => Mage::helper('M2ePro')->__('Status'), 'width' => '100px', 'index' => 'status', 'filter_index' => 'main_table.status', 'type' => 'options', 'sortable' => false, 'options' => array(Ess_M2ePro_Model_ListingsProducts::STATUS_NOT_LISTED => Mage::helper('M2ePro')->__('Not Listed'), Ess_M2ePro_Model_ListingsProducts::STATUS_LISTED => Mage::helper('M2ePro')->__('Listed'), Ess_M2ePro_Model_ListingsProducts::STATUS_SOLD => Mage::helper('M2ePro')->__('Sold'), Ess_M2ePro_Model_ListingsProducts::STATUS_STOPPED => Mage::helper('M2ePro')->__('Stopped'), Ess_M2ePro_Model_ListingsProducts::STATUS_FINISHED => Mage::helper('M2ePro')->__('Finished')), 'frame_callback' => array($this, 'callbackColumnStatus')));
     $this->addColumn('ebay_end_date', array('header' => Mage::helper('M2ePro')->__('eBay End Date'), 'align' => 'right', 'width' => '130px', 'type' => 'datetime', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM), 'index' => 'ebay_end_date', 'filter_index' => 'main_table.ebay_end_date', 'frame_callback' => array($this, 'callbackColumnEbayEndTime')));
     if (Mage::getIsDeveloperMode()) {
         $this->addColumn('developer_action', array('header' => Mage::helper('M2ePro')->__('Actions'), 'align' => 'left', 'width' => '100px', 'type' => 'text', 'index' => 'value', 'filter' => false, 'sortable' => false, 'filter_index' => 'cpev.value', 'frame_callback' => array($this, 'callbackColumnDeveloperAction')));
     }
     return parent::_prepareColumns();
 }
开发者ID:naz-ahmed,项目名称:ndap-magento-mirror,代码行数:28,代码来源:Grid.php

示例6: detect

 /**
  * @param Varien_Event_Observer $observer
  */
 public function detect(Varien_Event_Observer $observer)
 {
     $stores = $this->getHelper()->getStoreUrlOptionsAsArray();
     if ($lastUrl = $this->getSession()->getData('last_url')) {
         $parsedUrl = $this->getCoreUrl()->parseUrl($lastUrl);
         $scheme = $parsedUrl->getData('scheme');
         $host = $parsedUrl->getData('host');
         $currentUrl = $scheme . '://' . $host;
         /**
          * if in developer mode, we will concatenate the url by two parts of the url path
          * the url will be the developer ${scheme+host} + ${storeCode} if magento
          * runs on a virtual host, and ${scheme+host} + ${magentoRoot}+ ${storeCode} if otherwise.
          */
         if (Mage::getIsDeveloperMode()) {
             $pathParts = explode('/', ltrim($parsedUrl->getData('path'), '/'));
             if ($this->getHelper()->isVirtualHost()) {
                 $currentUrl .= "/{$pathParts[0]}";
             } else {
                 $currentUrl .= "/{$pathParts[0]}/{$pathParts[1]}";
             }
         }
         $storeCode = '';
         foreach ($stores as $store) {
             if (rtrim($currentUrl, '/') == rtrim($store['store_url'], '/')) {
                 $storeCode = $store['store_code'];
                 break;
             }
         }
         $this->getSession()->setData('old_store', $storeCode);
     }
 }
开发者ID:alaa-almaliki,项目名称:storeswitchdetector,代码行数:34,代码来源:Observer.php

示例7: log

 /**
  * Logging for Feed exporter
  * @param string $message
  * @param int $level  ZEND_LOG log level
  * @param boolean $bDeveloperModeOnly True to log only in Developer mode
  */
 public function log($message, $level = Zend_Log::INFO, $bDeveloperModeOnly = false)
 {
     if ($bDeveloperModeOnly == false || $bDeveloperModeOnly == true && Mage::getIsDeveloperMode()) {
         Mage::log($message, $level, self::LOG_FILE);
     }
     return $this;
 }
开发者ID:ernandes-xeo,项目名称:Aligent_Feeds,代码行数:13,代码来源:Log.php

示例8: renderBlockPlaceholder

 /**
  * Render placeholder tags around the block if needed
  *
  * Modified to not save JS to container cache.
  * Rely on the fact that JS is being moved to the end of the page
  * and that the JS is not changed after initial generation.
  *
  * @param Varien_Event_Observer $observer
  *
  * @return Enterprise_PageCache_Model_Observer
  */
 public function renderBlockPlaceholder(Varien_Event_Observer $observer)
 {
     if (!$this->_isEnabled) {
         return $this;
     }
     $block = $observer->getEvent()->getBlock();
     $transport = $observer->getEvent()->getTransport();
     $placeholder = $this->_config->getBlockPlaceholder($block);
     if ($transport && $placeholder && !$block->getSkipRenderTag()) {
         $blockHtml = $transport->getHtml();
         $request = Mage::app()->getFrontController()->getRequest();
         /** @var $processor Enterprise_PageCache_Model_Processor_Default */
         $processor = $this->_processor->getRequestProcessor($request);
         if ($processor && $processor->allowCache($request)) {
             $container = $placeholder->getContainerClass();
             if ($container && !Mage::getIsDeveloperMode()) {
                 $container = new $container($placeholder);
                 $container->setProcessor(Mage::getSingleton('enterprise_pagecache/processor'));
                 $container->setPlaceholderBlock($block);
                 // Modify to not save block with JS in it as JS is being moved to the end of the page.
                 $footerJs = Mage::helper('meanbee_footerjs');
                 $container->saveCache($footerJs->removeJs($blockHtml));
             }
         }
         $blockHtml = $placeholder->getStartTag() . $blockHtml . $placeholder->getEndTag();
         $transport->setHtml($blockHtml);
     }
     return $this;
 }
开发者ID:alex-borisenko,项目名称:magento-footer-js,代码行数:40,代码来源:Observer.php

示例9: send

 /**
  * Send all messages in a queue
  *
  * @return Mage_Core_Model_Email_Queue
  */
 public function send()
 {
     /** @var $collection Mage_Core_Model_Resource_Email_Queue_Collection */
     $collection = Mage::getModel('core/email_queue')->getCollection()->addOnlyForSendingFilter()->setPageSize(self::MESSAGES_LIMIT_PER_CRON_RUN)->setCurPage(1)->load();
     ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
     ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
     /** @var $message Mage_Core_Model_Email_Queue */
     foreach ($collection as $message) {
         if ($message->getId()) {
             $parameters = new Varien_Object($message->getMessageParameters());
             if ($parameters->getReturnPathEmail() !== null) {
                 $mailTransport = new Zend_Mail_Transport_Sendmail("-f" . $parameters->getReturnPathEmail());
                 Zend_Mail::setDefaultTransport($mailTransport);
             }
             $mailer = new Zend_Mail('utf-8');
             foreach ($message->getRecipients() as $recipient) {
                 list($email, $name, $type) = $recipient;
                 switch ($type) {
                     case self::EMAIL_TYPE_BCC:
                         $mailer->addBcc($email, '=?utf-8?B?' . base64_encode($name) . '?=');
                         break;
                     case self::EMAIL_TYPE_TO:
                     case self::EMAIL_TYPE_CC:
                     default:
                         $mailer->addTo($email, '=?utf-8?B?' . base64_encode($name) . '?=');
                         break;
                 }
             }
             if ($parameters->getIsPlain()) {
                 $mailer->setBodyText($message->getMessageBody());
             } else {
                 $mailer->setBodyHTML($message->getMessageBody());
             }
             $mailer->setSubject('=?utf-8?B?' . base64_encode($parameters->getSubject()) . '?=');
             $mailer->setFrom($parameters->getFromEmail(), $parameters->getFromName());
             if ($parameters->getReplyTo() !== null) {
                 $mailer->setReplyTo($parameters->getReplyTo());
             }
             if ($parameters->getReturnTo() !== null) {
                 $mailer->setReturnPath($parameters->getReturnTo());
             }
             try {
                 //$mailer->send();
                 $mailer->send(Mage::helper('smtp')->getTransport());
                 unset($mailer);
                 $message->setProcessedAt(Varien_Date::formatDate(true));
                 $message->save();
             } catch (Exception $e) {
                 unset($mailer);
                 $oldDevMode = Mage::getIsDeveloperMode();
                 Mage::setIsDeveloperMode(true);
                 Mage::logException($e);
                 Mage::setIsDeveloperMode($oldDevMode);
                 return false;
             }
         }
     }
     return $this;
 }
开发者ID:TomOhme,项目名称:IP1-Webshop,代码行数:64,代码来源:Queue.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_block = new Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples();
     $this->_oldDisplayErrors = ini_get('display_errors');
     $this->_oldErrorLevel = error_reporting();
     $this->_oldIsDeveloperMode = Mage::getIsDeveloperMode();
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:SamplesTest.php

示例11: preDispatch

 /**
  * Ensure dev mode for manual feed generation.
  */
 public function preDispatch()
 {
     parent::preDispatch();
     if (!Mage::getIsDeveloperMode()) {
         $this->norouteAction();
         $this->setFlag('', 'no-dispatch', true);
     }
 }
开发者ID:adrian-green,项目名称:productfeed,代码行数:11,代码来源:ProcessController.php

示例12: isDebug

 /**
  * @return bool
  */
 public function isDebug()
 {
     if ($this->isAppInited()) {
         return Mage::getStoreConfigFlag(self::XML_PATH_DEBUG);
     } else {
         return Mage::getIsDeveloperMode();
     }
 }
开发者ID:skmezanul,项目名称:Cm_Diehard,代码行数:11,代码来源:Data.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_object = new Stub_UnitTest_Mage_Catalog_Model_Resource_Product_Option_Value();
     $this->_oldDisplayErrors = ini_get('display_errors');
     $this->_oldErrorLevel = error_reporting();
     $this->_oldIsDeveloperMode = Mage::getIsDeveloperMode();
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:ValueTest.php

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_object = new Stub_UnitTest_Mage_ImportExport_Model_Export_Entity_Product();
     $this->_oldDisplayErrors = ini_get('display_errors');
     $this->_oldErrorLevel = error_reporting();
     $this->_oldIsDeveloperMode = Mage::getIsDeveloperMode();
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:ProductTest.php

示例15: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     $fixtureDir = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files';
     Mage::app()->getConfig()->getOptions()->setDesignDir($fixtureDir . DIRECTORY_SEPARATOR . 'design');
     Varien_Io_File::rmdirRecursive(Mage::app()->getConfig()->getOptions()->getMediaDir() . '/skin');
     $ioAdapter = new Varien_Io_File();
     $ioAdapter->cp(Mage::app()->getConfig()->getOptions()->getJsDir() . '/prototype/prototype.js', Mage::app()->getConfig()->getOptions()->getJsDir() . '/prototype/prototype.min.js');
     self::$_developerMode = Mage::getIsDeveloperMode();
 }
开发者ID:rorteg,项目名称:magento2,代码行数:9,代码来源:PackageTest.php


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