Jump to content

Share include files between modules and hooks


jose.felipe

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated