本文整理汇总了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');
}
示例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;
}
示例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());
}
}
}
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例11: preDispatch
/**
* Ensure dev mode for manual feed generation.
*/
public function preDispatch()
{
parent::preDispatch();
if (!Mage::getIsDeveloperMode()) {
$this->norouteAction();
$this->setFlag('', 'no-dispatch', true);
}
}
示例12: isDebug
/**
* @return bool
*/
public function isDebug()
{
if ($this->isAppInited()) {
return Mage::getStoreConfigFlag(self::XML_PATH_DEBUG);
} else {
return Mage::getIsDeveloperMode();
}
}
示例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();
}
示例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();
}
示例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();
}