Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Calling API1 functions from a custom Cpanel module

Discussion in 'cPanel Developers' started by RSimoes, Jan 27, 2010.

  1. RSimoes

    RSimoes Member
    PartnerNOC

    Joined:
    Oct 9, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Austin, TX
    I'd like to call the API1 function Mysql::adddb from a Perl cPanel module I wrote. It is trivial to call API2 functions by just use'ing the necessary module and calling the api2_ sub, but this does not seem to be the case with API1. Is there an easy way to do this?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. RSimoes

    RSimoes Member
    PartnerNOC

    Joined:
    Oct 9, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Austin, TX
    OK, I found a (the?) function after digging around in /usr/local/cpanel/Cpanel/. In case anyone else is curious:

    Code:
    use Cpanel::AdminBin;
    Cpanel::AdminBin::adminrun('mysql', 'ADDDB', 'dbname');
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 RSimoes, Jan 27, 2010
    Last edited: Jan 27, 2010
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice