[Vtigercrm-developers] Let's make 7.4 fruitful

Alan Lord alanslists at gmail.com
Thu Oct 1 19:32:56 GMT 2020


For an old idiot like me, please could someone explain what the actual 
*benefits* of implementing composer in vtiger would be?

I've made several modules for customers which require the weird 
namespace syntax and stuff and I have found that this is very trivial to 
support by creating an "AutoLoader" in my module and simply including 
it, e.g.

> namespace PhpOffice;
> 
> spl_autoload_register(function ($class) {
>     if (substr($class, 0, strlen(__NAMESPACE__)) != __NAMESPACE__) {
>         //Only autoload libraries from this package
>         return;
>     }
>     $path = substr(str_replace('\\', '/', $class), 9);
>     $path = 'modules/LSMyCustomModule/resources/PhpOffice' . $path . ".php";
>     if (file_exists($path)) {
>         require $path;
>     }
> });

Maybe I am missing some of the other benefits, but I would like to know 
what benefits this would bring and how it would make my life easier?

TIA

Al


On 01/10/2020 19:35, Matteo Baranzoni wrote:
> Hi, my friend Francesco open discussion here: 
> https://discussions.vtiger.com/discussion/192211/official-php-composer-for-vtiger/p1?new=1
> 
> And i just add it on hearken, i think that move php dependencies to 
> composer it was great improvement!
> We can contribute in order to complete porting





More information about the vtigercrm-developers mailing list