Since a given module installation is defined by the manifest.php included in the zip it is basically up to each developer to decide how to package their module. This flexibility is great but can cause both confusion for new developers and for folks trying to understand what a module zip contains. For the latter, this could be end users who like to know every detail or it could be a developer who is taking on or contributing to someone else's module.
For this article we won't be recommending a full SugarCRM Module Standardization like has been done here: A Proposal for SugarCRM Module Standardization. Instead we are going to suggest one way of organizing and look to get your own suggestions on how to better organize modules.
In a manifest there basically 3 types of options that require files to be defined; copy, relationships, and the many different extensions (language, vardefs, layoutdefs, menu, etc). Due to the way they are used to install into SugarCRM it may make the most sense to separate them out into their own folders in a zip such as:
- /copy
- /extensions
- /relationships
- LICENSE.txt
- manifest.php
The copy and extensions directories would be broken down to mimic the module file structure in Sugar. For example:
- /copy
/custom/modules/AccountsMyAwesome_logic_hook.php/modules/MyAwesomeModule
- /extensions
/modules/Accounts/language/vardefs
Relationships would just contain the files that will eventually be copied over to the custom/metadata directory:
- /relationships
MyAwesomeModule_AccountsMetaData.php
Here is how the manifest would then look like for these option definitions:
'copy' => array ( | |
array ( | |
'from' => '<basepath>/copy/custom/modules/Accounts/MyAwesome_logic_hook.php', | |
'to' => 'custom/modules/Accounts/MyAwesome_logic_hook.php', | |
), | |
array ( | |
'from' => '<basepath>/copy/modules/MyAwesomeModule', | |
'to' => 'modules/MyAwesomeModule', | |
), | |
), | |
'relationships' => array ( | |
array ( | |
'module' => 'Accounts', | |
'meta_data' => '<basepath>/relationships/MyAwesomeModule_AccountsMetaData.php', | |
), | |
), | |
'language' => array ( | |
array('from'=> '<basepath>/extensions/modules/Accounts/language/en_us.myawesome.php', | |
'to_module'=> 'Accounts', | |
'language'=>'en_us' | |
), | |
), | |
'vardefs' => array ( | |
array ( | |
'from' => '<basepath>/extensions/modules/Accounts/vardefs/myawesomeVardefs.php', | |
'to_module' => 'Accounts', | |
), | |
), |
We'll continue to build on this idea of better organizing modules to include the other parts of a manifest definition. Have something you found that works well? Share it below!
-
Ambit Key Account Management (KAM)
FEATUREDAmbit Key Account Management (KAM) solution simplifies and brings value to the Account Planning and Account Management processes for your most important sales personnel – your Key Account Manage... -
Upsert® Migrator
FEATUREDA development framework that assists developers in generating database migrations for schema changes, data updates, and even promoting Sugar upgrades between environments. -
Fanatically Zen with SugarCRM and Zendesk
FEATUREDEmpower your support and sales teams with clear visibility to the right data, right when they need it. With the Zendesk and Sugar integration, your teams will be able to stay up-to-date on all relevan... - Show more addons