<div dir="ltr">What I feel is that we can really do better dependent library management using composer.<div><br></div><div>The autoloader could be included in the Vtiger's Loader file.</div><div><br></div><div>The challenge would be if a custom module needs a library which is not included as default, so then how do we package the extension..</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 2, 2020 at 1:04 AM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For an old idiot like me, please could someone explain what the actual <br>
*benefits* of implementing composer in vtiger would be?<br>
<br>
I've made several modules for customers which require the weird <br>
namespace syntax and stuff and I have found that this is very trivial to <br>
support by creating an "AutoLoader" in my module and simply including <br>
it, e.g.<br>
<br>
> namespace PhpOffice;<br>
> <br>
> spl_autoload_register(function ($class) {<br>
>     if (substr($class, 0, strlen(__NAMESPACE__)) != __NAMESPACE__) {<br>
>         //Only autoload libraries from this package<br>
>         return;<br>
>     }<br>
>     $path = substr(str_replace('\\', '/', $class), 9);<br>
>     $path = 'modules/LSMyCustomModule/resources/PhpOffice' . $path . ".php";<br>
>     if (file_exists($path)) {<br>
>         require $path;<br>
>     }<br>
> });<br>
<br>
Maybe I am missing some of the other benefits, but I would like to know <br>
what benefits this would bring and how it would make my life easier?<br>
<br>
TIA<br>
<br>
Al<br>
<br>
<br>
On 01/10/2020 19:35, Matteo Baranzoni wrote:<br>
> Hi, my friend Francesco open discussion here: <br>
> <a href="https://discussions.vtiger.com/discussion/192211/official-php-composer-for-vtiger/p1?new=1" rel="noreferrer" target="_blank">https://discussions.vtiger.com/discussion/192211/official-php-composer-for-vtiger/p1?new=1</a><br>
> <br>
> And i just add it on hearken, i think that move php dependencies to <br>
> composer it was great improvement!<br>
> We can contribute in order to complete porting<br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>