memegento/module-mage

The Legend Returns

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:magento2-module

1.0.1 2022-08-20 10:54 UTC

This package is auto-updated.

Last update: 2025-06-20 16:57:54 UTC


README

Buy Me A Coffee

This module adds the legendary Mage class from Magento 1 to Magento 2. Now developers can write Magento 1-like code in Magento 2 or event port Magento 1 code to Magento 2 without any changes.

Pull requests from the community are welcomed!

Requirements

  • PHP 7.4+
  • Magento 2 CE or EE installation

Installation

composer require memegento/mage

Usage

Mage class provides some basic methods to interact with Magento 2 as if it were Magento 1.

$productModelLegacyWay = Mage::getModel('catalog/product');

$productModelNewWay = Mage::getModel(\Magento\Catalog\Model\Product::class);

$productUrl = Mage::getUrl('catalog/product/view', ['product_id' => $productId]);

Mage::log('Some message', ['context_field' => 'value'], Zend_Log::INFO);
Mage::throwException('Exception message');

Compatibility

  • 2.4.x Magento 2 Open Source or Commerce Edition