johnxx
October 15, 2019, 12:12pm
1
Hello,
I’d like to include a dependency extra by using MyComponents.
I saw this page “Package Dependencies”
https://docs.modx.com/revolution/2.x/developing-in-modx/advanced-development/package-management/package-dependencies
I know I can easily add a subpackage but
I don’t know if it’s the right way regarding licence because the subpackage is not one of mine.
Can I add this code :
requires’ => array(
‘formit’ => ‘>=2.2.0’,
)
directly in MyComponents config file (e.g. example.config.php) ?
bobray
October 16, 2019, 2:47am
2
It won’t work to put that in the MC config file, but you should be able to put in in your build.transport.php file like this:
$attr = array(
'license' => file_get_contents($sources['docs'] . 'license.txt'),
'readme' => file_get_contents($sources['docs'] . 'readme.txt'),
'changelog' => file_get_contents($sources['docs'] . 'changelog.txt'),
'requires' => array(
'formit' => '>=2.2.0',
),
);
MyComponent will never modify an existing build.transport.php file.
You can include other peoples’ work as long as you meet the criteria in their license statement. Most MODX extras have a GPL license, so it’s fine to include them as long as you distribute their license along with them (which will happen automatically with MyComponent).
johnxx
October 16, 2019, 7:33am
3
Thank you very much Bob ! It works perfectly !
bobray
October 19, 2019, 5:14am
4
I’m glad I could help. Thanks for reporting back.