Extend Pacemaker Community Edition with additional libraries and vendors

For more complex projects, additional libraries may get needed.

Pacemaker Community Edition Console Tool uses Symfony DI container. Therefore, it is necessary to register other libraries by adding them to the configuration file.

  • It is strongly recommended that, by default, the value for custom-configuration-dir is <magento-install-directory>/app/etc/configuration

  • As soon as a default configuration is copied, changed, extended, or modified and stored under the path specified in custom-configuration-dir, only this configuration takes effect and always overwrites the original configuration

  • The configuration handling is mainly based on the PHP framework Symfony, and therefore unexpected effects maid occur in different configuration constellations

    • Consequently, it is always recommended to test modified configurations concerning unwanted side effects

When developing an extension library, the Symfony DI configuration must get provided

Depending on the type of Pacemaker Community Edition Console Tool installation (PHAR, Composer), there are the following two options available:

Extension libraries

Is the Pacemaker Community Edition Console Tool being installed as a Composer library and a Magento 2 installation?

The easiest way to register an additional extension is to create and add a snippet, e.g., <custom-configuration-dir>/extension-libraries.json, containing the library names needed

<custom-configuration-dir>/extension-libraries.json
{
  "extension-libraries" : [
    "techdivision/import-product-magic360"
  ]
}

Only if the extension library uses the same Composer autoloader as Pacemaker Community Edition Console Tool it is possible to include the extension library.

When installing with the PHAR version of Pacemaker Community Edition, it is required to use the additional-vendor-dirs directive.

Additional vendor directories

Only if the extension library uses the same Composer autoloader as Pacemaker Community Edition Console Tool it is possible to include the extension library.

PHAR installation

When installing with the PHAR version of Pacemaker Community Edition, it is required to use the configuration additional-vendor-dirs directive.

{
  "additional-vendor-dirs" : [ (1)
    {
      "vendor-dir": "vendor",
      "relative": true,
      "libraries": [
        "techdivision/import-adapter-custom"
      ]
    }
  ]
}
1 Use the additional-vendor-dirs directive to add additional vendor directories to the configuration