jose.felipe Posted January 28, 2011 Share Posted January 28, 2011 hi, I need to integrate whmcs with a 3rd party webservice. So, when the user registers in whmcs, i need to register him into the webservice, and when the user completes an order, i need to register that too in the webservice. In the first case, i created a hook, meant to run after client registration. And for the second case, I developed a module. The problem is: I need to share some files between the hook and the module. I've tried to have one copy of each such file, one in the hooks directory, and other in the modules/servers directories, but it seems that by doing so whmcs includes each file twice(although i use require_once) and I got an error saying i'm redefining some functions. A possible solution would be mantain just one copy of each file, let us say in the modules/servers dir, and then in the hook include the file from there. but that's not working too, i got a error saying that the file could not be included. anyone can tell how the best way to do it? 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted January 28, 2011 Share Posted January 28, 2011 include('/home/username/public_html/whmcs/includes/file.php'); OR, If you are using a hook or a module that is loaded by WHMCS and not standalone, you can use the following. include(ROOTDIR.'/includes/file.php'); 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.