crupsos Posted September 22, 2021 Share Posted September 22, 2021 Hello, i use PhpStorm and would like to use code completion. I just don't know how to do that. How can I completely import whmcs that I can use "WHMCS\Database\Capsule;". Here is a picture. In the lib folder is all... 0 Quote Link to comment Share on other sites More sharing options...
0 steven99 Posted September 28, 2021 Share Posted September 28, 2021 Capsule is a wrapper Eloquent. Just get Eloquent from github and put it some where central for such libs. Then in phpStorm, edit the project settings and add the directory as a resource root. Have not tested with capsule, just with models, but should be able to use: use Illuminate\Database\Capsule\Manager as Capsule; 0 Quote Link to comment Share on other sites More sharing options...
0 pRieStaKos Posted September 30, 2021 Share Posted September 30, 2021 (edited) I'm using PhpStorm too and namespaces/classes always returns Undefined, but work. It's how PhpStorm reads the class structure. Skip this as you hooks/scripts work as expected. Edited September 30, 2021 by pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
0 steven99 Posted September 30, 2021 Share Posted September 30, 2021 Create directory WHMCS/Database and create file Capsule.php . In that file put in: namespace WHMCS\Database\Capsule; use Illuminate\Database\Capsule\Manager; class Capsule extends Manager { } Go to directories mentioned above and add that new directory to the resource roots. I create create classes and fill them with variables and do this for their other classes so phpstorm will give hints. Stubs are good or at least that is what I call it. Just don't include that file within your actual module / code though. 0 Quote Link to comment Share on other sites More sharing options...
0 string Posted September 30, 2021 Share Posted September 30, 2021 https://github.com/indicio-software/whmcs-ide-helper 0 Quote Link to comment Share on other sites More sharing options...
-1 developer _WHM_CS Posted September 23, 2021 Share Posted September 23, 2021 Hi @crupsos Whmcs coded all files in that location by Ioncube therefore you can not use code completion if you include init.php ( it is in WHMCS root directory ) all namespace will be work in your code 0 Quote Link to comment Share on other sites More sharing options...
Question
crupsos
Hello,
i use PhpStorm and would like to use code completion. I just don't know how to do that. How can I completely import whmcs that I can use "WHMCS\Database\Capsule;". Here is a picture. In the lib folder is all...
Link to comment
Share on other sites
5 answers to this question
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.