Jump to content

Drupal Breaks Internal API


namhost

Recommended Posts

I am trying to switch from using the normal api, to using the internal API. Everything has gone swimmingly, except now when I try to run "AddClient". And only if I run it from within Drupal. So this works:

<?php

    require_once("./init.php");
    var_dump($whmcs):

?>

But put those lines inside of a Drupal module, and $whmcs is null. 

I thought it was perhaps a $whmcs or other global variable that is set or used in init.php and somehow that causes the $whmcs to be null. Reason for that is if I actually try to run "AddClient", I end up with this error:

17 {main} {"exception":"[object] (Error(code: 0): Call to a member function get_config() on string at \includes\clientfunctions.php:0)"} []

According to the guys at WHMCS, this is the code being hit:

<?php

    $companyName = $whmcs->get_config('CompanyName');
    
?>


Why in Drupalk would $whmcs become a string? Did it not get initalized? If not, why? 

Any ideas?
 

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