Jump to content

issue with custom module


Remitur

Recommended Posts

Hello.

I'm writing a gateway module (mygateway.php), which need another stand-alone php file (mygateway2.php)

Both are in whmcs/modules/gateways/

 

mygateway2.php need to interact with db, so (according to http://docs.whmcs.com/Interacting_With_The_Database ) it begin with

 

use Illuminate\Database\Capsule\Manager as Capsule;

 

The problem is I get always an error of this kind:

 

PHP Fatal error: Class 'Illuminate\Database\Capsule\Manager' not found in /home/a856314wib/public_html/mydomain.ext/whmcs/modules/gateways/mygateway1.php on line 52

 

I tried with different paths, but or I did'nt guess the right one, or I lost some "include" which is necessary... :-(

Link to comment
Share on other sites

Solved!

It was both a problem of include, and of relative path.

 

It was necessary to insert:

 

require_once __DIR__ . '/../../init.php';

require_once __DIR__ . '/../../includes/gatewayfunctions.php';

require_once __DIR__ . '/../../includes/invoicefunctions.php';

 

 

(the third one probably is useless, I have not checked it yet)

 

Thannk you for suggestion.

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