<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Submit MR to increase the compatibility.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 2, 2021 at 2:59 AM Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</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">
<div>
<div name="messageBodySection">
<div dir="auto">Hi all,<br>
<br>
I’ve done a static analysis for the new release. The idea is to highlight are of interventions, defining a starting point to decrease the technical debt this project has piled up.<br>
<br>
I’ve tried to run the project (clean install) with php7.4 and mysql 8 + docker, install started unfortunately I had 504 during the installation but I’m working on it, when it’s finished I’ll be sharing my GitHub repo with a working docker file with LEMP. I’ve tried PHP8 too just out of curiosity. As expected it doesn’t even launch the wizard: a lot of fatal errors. For the moment I can tell these 2:<br>
1. PearDatabase: use of curly braces instead of []<br>
2. AntlrLexer: them Ian class seems to be extending a base class but it’s following the definition in the base class for matchAny and Re. I couldn’t find the php version for this project, so if you guys wrote it, look at it.<br>
<br>
Now coming back to static Analysis, I’ve done it with PHPInsights for the modules folder (launch this command from cam root folder - after install through composer - : php -d memory_limit=4000M ./vendor/bin/phpinsights analyse modules ), you can find it zipped as a json file, the tool did truncated some but since it’s easy to launch please do relaunch it. - although it will take a bit… the generated file is about 85MB...<br>
<br>
Some thoughts:<br>
As expected there is no proper implementation of OOP (No visibility keywords, no namespaces), there is extensive use of global variables and super global variables such as $_REQUEST - which is needless to say harmful. Other than this there are too many nested loops (in some part nested loop level is 7 whereas recommended is 2 or 3, this has huge implications on performance!), many declared and unused variables.<br>
<br>
It’s safe to say that if PHP7.4 is still letting some of the old practices go on, PHP8 will break the code badly, since most of the code is legacy. I was hoping that at least there would be composer but that’s for the next release, hopefully.<br>
<br>
What are your thoughts? How can we start to approach?</div>
</div>
<div name="messageSignatureSection"><br>
<div><font color="#C6C6C6"><b><span>Sukhdev Mohan</span></b></font><span></span><br>
<font color="#999999"><b><span>Developer</span></b></font><br></div>
</div>
</div>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>