How to Use Composer Packages in Magento 1 / OpenMage

Posted Almost 3 years ago. Visible to the public.

OpenMage

Install the packages in vendor directory in the root by execute shell command: composer update

For wins:

PHP is not recognized as an internal or external command in command prompt

  1. Search: Edit the system environment variables
  2. Environment Variables ...
  3. System variables > Path > Edit ...
  4. New
  5. Then add D:\Work\wamp64\bin\php\php8.2.5

For Magento 1.9 (Not required for OpenMage)

Create dir vendor in the root and then modify Mage.php:

// in app\Mage.php
// Insert this line or make use of line 57.
require BP.DS.'vendor/autoload.php';

//Line 57:
/* Support additional includes, such as composer's vendor/autoload.php files */
foreach (glob(BP . DS . 'app' . DS . 'etc' . DS . 'includes' . DS . '*.php') as $path) {
    include_once $path;
}

Generate the file vendor/autoload.php with this BASH command:

php composer.phar dump-autoload
kiatng
Last edit
12 months ago
kiatng
Posted by kiatng to OpenMage (2021-05-23 08:02)