X-Cart:Integration with third party modules
From Qualiteam Help
3rd party module initialization
In version 4.4.3, the module initialization routine has been changed and optimized. Unlike in versions 4.4.0-4.4.2, initialization order now does matter.
For the standard modules, dependencies of the modules on one another are described in the function include/data_cache.php:func_sort_active_modules
If your 3rd-party module depends on other modules, and no other modules depend on it, you can place the initialization of that module to the very end of the module initialization queue.
Here is how you do that.
--- include/data_cache.php 2011-05-16 14:11:41.000000000 +0400 +++ include/data_cache.php 2011-05-16 14:11:37.000000000 +0400 @@ -144,6 +144,7 @@ 'Image_Verification' => 33,# Image_Verification depends on Survey/News_Management 'Manufacturers' => 23, 'XAffiliate' => 24, #XAffiliate depends on Manufacturers + '3dPartyModule1' => 2000, ); $key_a = isset($sort_order[$a]) ? -$sort_order[$a] : -1000; $key_b = isset($sort_order[$b]) ? -$sort_order[$b] : -1001;
This patch means that 3dPartyModule1 will be initialized last for this array of modules.
If the order number of a certain module is not defined, it is assumed to be 1000. The initialization order for modules with identical module numbers is undefined.
Reserved service names
Below is a list of service names used by Qualiteam solutions:
Service names of X-Cart modules:
Names of sql tables:
- prefixed with "xcart_"
Names of sql config variables:
- See: sql/xcart_data.sql
Names of sql labels:
- See: sql/xcart_languages_US.sql
To avoid service name conflicts with Qualiteam solutions, developers of 3rd party add-on modules should avoid using the above listed service names for the purpose of naming entities pertaining to their work.
It is strongly recommended that a unique prefix be used for your add-on module in all labels, sql-xcart_config, sql-xcart_languages, sql-xcart_modules, global variables, module name and names of module files.