1

I want to create a SugarCRM module for redistribution. Where should I populate $beanList, $beanFiles, and $moduleList?

That is, if I use the module generator to create a SugarCRM module, the system will auto generate the following file

custom/application/Ext/Include/modules.ext.php

which populates the three global variables $beanList, $beanFiles, and $moduleList with something like this (assuming a module name of pshw_Helloworld.

$beanList['pshw_Helloworld'] = 'pshw_Helloworld';
$beanFiles['pshw_Helloworld'] = 'modules/pshw_Helloworld/pshw_Helloworld.php';
$moduleList[] = 'pshw_Helloworld';

This works great for a local system — but if I wanted to redistribute a module (offered for downloading online, deployed to multiple offices, etc.), should I be instructing people to populate the modules.ext.php or modules_override.php file themselves? Or is there a more elegant way of redistributing a SugarCRM module that uses a bean?

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • You might want to take a look at my answer here: http://stackoverflow.com/a/15259436/76772 This gives the full code for a very basic, redistributable, SugarCRM plug-in. This doesn't include any Bean files, but might help you to understand the basic structure of a redistributable package. – Kyle Lowry Mar 15 '13 at 17:29

1 Answers1

1

This is all done automatically by including a manifest.php in your module zip. The Module Loader will read the manifest and create these entries for you. The key is the 'beans' key in the $installdefs array. More info can be found here: Introduction to the Manifest File

egg
  • 1,736
  • 10
  • 12
  • +1 for good information — but I think you threw me in the deep end. What is this modules.zip file you speak of? Is there a tutorial on creating this file anywhere? Once I have a modules.zip, how would someone who wanted to use my module load this into their system? – Alana Storm Mar 15 '13 at 03:42
  • IMHO the best way to learn how to create a mass distributable module is to see how folks have already done it on SugarForge. SugarCRM comes with a tool found under Admin called Module Loader where these zip files can be uploaded and installed. For a tutorial, this is a good start: http://support.sugarcrm.com/04_Find_Answers/03_Developers/Module_Loader – egg Mar 15 '13 at 03:49