Unified Namespace Generator

See github-repository

This component is responsible for creating the classes of the namespace OxidEsales\Eshop which are called unified namespace classes.

When do the unified namespace classes get generated?

The unified namespace generator implements a composer plugin and a standalone script. It generates the unified namespace classes on the fly, e.g. when you install or update the OXID eShop:

The generation of unified namespace classes is triggered by running

  • composer create-project with the OXID eShop metapackage

  • composer install

  • composer update. If you want to be sure, to get no errors because of an old version of the unified-namespace-generator, first run composer update --no-plugins --no-scripts and afterwards composer update. If you directly execute first composer update, you may encounter errors. In this case, run again composer update and the errors should go away.

  • composer require. If you want to be sure, to get no errors because of an old version of the unified-namespace-generator, first run composer require --no-update and afterwards composer update.

  • reset-shop

  • by manually executing vendor/bin/oe-eshop-unified_namespace_generator

Mode Of Operation

Given the example you run the following command:

composer create-project --no-dev oxid-esales/oxideshop-project my_oxid_eshop_project dev-b-6.0-ce

By triggering the generation with other commands the steps 1 and 2 can be different.

  1. Download and install all libraries to the folder vendor

  2. oxideshop-unified-namespace-generator is executed by the composer event POST_INSTALL

  3. Collect the files Core/Autoload/UnifiedNamespaceClassMap.php from each installed edition. Collect the file Core/Autoload/BackwardsCompatibilityClassMap.php from OXID eShop Community Edition

  4. Generate the unified namespace classes and write them to the folder vendor/oxid-esales/oxideshop-unified-namespace-generator/generated. There should be one unified namespace class for every class in the OXID eShop edition.

Searching for errors

If you get either errors

  • by calling on of the commands of this section or

  • you get a message that a unified namespace class could not be found like

Class OxidEsales\Eshop\Core\ConfigFile not found in bootstrap.php on line 18

Then, you should read the following steps in order to find the reason for the error:

  1. Have a look at the directory vendor/oxid-esales/oxideshop-unified-namespace-generator/generated

  2. Are the unified namespace classes inside this directory, have the correct namespace and extend the correct edition class?

  3. Be sure, the directory has write permissions

  4. Execute the command vendor/bin/oe-eshop-unified_namespace_generator manually and look for errors

  5. Be sure, the requirements as stated in Mode Of Operation are fulfilled