PapaKai Posted August 17, 2022 Share Posted August 17, 2022 (edited) Hi there, I am interested in using phpstan for static code analysis, but wasn't able to get WHMCS source files bootstrapped. Does anyone of you guys have experience and a working setup? If I try to load/bootstrap the init.php, I am ending in "Fatal error: Uncaught Error: Class 'Hoa\Event\Bucket' not found ...". This is independent of dealing just with freshly unzipped archive or using source files of a installed whmcs system. When just loading files from includes directory, not all functions I am looking for are finally present. ioncube loader is installed and up & working in our setup. Thanks Kai Edited August 17, 2022 by PapaKai 1 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 17, 2022 Share Posted August 17, 2022 Hello. Just a quick question for verification: - You want to code analysis encrypted commercial files ? 0 Quote Link to comment Share on other sites More sharing options...
PapaKai Posted August 18, 2022 Author Share Posted August 18, 2022 (edited) No, we are writing Modules/Addons for WHMCS. The code is finally a mixture of our produced code that is in some cases using functions / classes of WHMCS (e.g. https://classdocs.whmcs.com/8.5/index.html). Therefore, it is necessary to bootstrap the necessary underlying system (or a subset of files or so), so that phpstan is able to identify return types, parameter types etc. and to use it for validation. I am not interested in analysing WHMCS itself (that would even mean doing reverse engineering - which is prohibited by WHMCS' EULA. Edited August 18, 2022 by PapaKai 0 Quote Link to comment Share on other sites More sharing options...
PapaKai Posted August 18, 2022 Author Share Posted August 18, 2022 Looks like I got it working. 1 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 18, 2022 Share Posted August 18, 2022 1 hour ago, PapaKai said: No, we are writing Modules/Addons for WHMCS. The code is finally a mixture of our produced code that is in some cases using functions / classes of WHMCS (e.g. https://classdocs.whmcs.com/8.5/index.html). Therefore, it is necessary to bootstrap the necessary underlying system (or a subset of files or so), so that phpstan is able to identify return types, parameter types etc. and to use it for validation. I am not interested in analysing WHMCS itself (that would even mean doing reverse engineering - which is prohibited by WHMCS' EULA. Thank you for your confirmation. 2 minutes ago, PapaKai said: Looks like I got it working. Happy to hear that. As this is a community board, please post your solution to assist other users, dealing with the same issue. If you like to. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.