Unified Namespace Generator
The component unified-namespace-generator
generates the classes of the namespace
OxidEsales\Eshop which are called
unified namespace classes.This is done on the fly, e.g. when you install
or update the OXID eShop.
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 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.
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.
Download and install all libraries to the folder vendor
oxideshop-unified-namespace-generator is executed by the composer event POST_INSTALL
Collect the files
Core/Autoload/UnifiedNamespaceClassMap.phpfrom each installed edition. Collect the file Core/Autoload/BackwardsCompatibilityClassMap.php from OXID eShop Community Edition
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:
Have a look at the directory
Are the unified namespace classes inside this directory, have the correct namespace and extend the correct edition class?
Be sure, the directory has write permissions
Execute the command vendor/bin/oe-eshop-unified_namespace_generator manually and look for errors
Be sure, the requirements as stated in Mode Of Operation are fulfilled