Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 39
  1. #1
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default Use API1 and API2

    I am a newbie,
    I read the Interested? - HOW TO: Create your own remote access features in PHP

    I understood the thing
    But now in 11.24 its mentioned that cPanel::Accounting PHP Module is deprecated and XML API is In
    I know the XML commands also by now!

    But I am confused on the following for Plugins:
    1) Should the Plugin we create be in http://WHM/frontend/x3/myplugin
    (I saw this in ROR, fantastico) or in the 3rdparty folder
    2) How to call XML API in the PHP Plugin sript ?
    - using the Web like file_get_contents()
    - OR fsockopen

    I want to make a plugin like ROR, Fantastico - I mean the way they operate in the end user CPanel.

    Please help

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    I am a newbie,
    I read the Interested? - HOW TO: Create your own remote access features in PHP

    I understood the thing
    But now in 11.24 its mentioned that cPanel::Accounting PHP Module is deprecated and XML API is In
    I know the XML commands also by now!

    But I am confused on the following for Plugins:
    1) Should the Plugin we create be in http://WHM/frontend/x3/myplugin
    (I saw this in ROR, fantastico) or in the 3rdparty folder
    2) How to call XML API in the PHP Plugin sript ?
    - using the Web like file_get_contents()
    - OR fsockopen

    I want to make a plugin like ROR, Fantastico - I mean the way they operate in the end user CPanel.

    Please help
    You're crossing a lot of different territory there in the post.

    Are you looking to create a plug-in? A plug-in is something like Fantastico where it is accessed via the cPanel interface. If so, then you likely will not be using the XML-API. The XML-API is designed for external scripts (e.g. billing applications) to interact with cPanel's APIs. If you are building a plug-in, your script will be running on cpsrvd, thus will not need XML-API wrappers to access API1/API2 functionality. You would simply use API1/API2 directly or use our LivePHP wrapper.

  3. #3
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Thanks for clearing those confusions
    Also can you just tell me what is LivePHP wrapper and how can I access / use API1/API2 directly

    AND my files will be placed in :
    usr/local/cpanel/whostmgr/docroot/cgi/
    OR
    frontend/x3/

    Is there some detailed guide about how to make a Pluging like Fantastico or ROR

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    Thanks for clearing those confusions
    Also can you just tell me what is LivePHP wrapper and how can I access / use API1/API2 directly

    AND my files will be placed in :
    usr/local/cpanel/whostmgr/docroot/cgi/
    OR
    frontend/x3/

    Is there some detailed guide about how to make a Pluging like Fantastico or ROR
    Just to be clear, Ruby on Rails is native functionality of cPanel/WHM - it is not a plug-in.

    There's a crash course on all of our APIs as well as LivePHP in the following presentation:

    http://www.cpanel.net/conference/08/files/APIs.pdf

    The cPanel Plugin will be stored in:

    /usr/local/cpanel/base/frontend/$themename/$somedir

    Where $themename is the name of a theme (e.g. x3) and $somedir is some directory where you're placing your plugin file(s).

    As for making a WHM plug-in, some documentation for that can be found at:

    http://www.cpanel.net/support/docs/modules/index.html

  5. #5
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Thanks a million
    Just to clear my last doubts
    1) Why is Fantastico stored in /usr/local/cpanel/whostmgr/docroot/cgi(thats what i saw in its files)
    2) If the plugin is in /usr/local/cpanel/base/frontend/$themename/$somedir then what about other themes in CPanel
    Will the plugin be available then ?
    3) Cant modules be created in PHP. The above docs are for Perl Modules. But Fantastico is in PHP with just installation addon_fantastico.cgi in PERL Language !
    Last edited by rongup; 12-30-2008 at 12:42 PM.

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    Thanks a million
    Just to clear my last doubts
    1) Why is Fantastico stored in /usr/local/cpanel/whostmgr/docroot/cgi(thats what i saw in its files)
    2) If the plugin is in /usr/local/cpanel/base/frontend/$themename/$somedir then what about other themes in CPanel
    Will the plugin be available then ?
    1. I assume that would be the WHM Plug-in component of Fantastico.

    2. The plug-in installer will install an icon for your plug-in to all themes that support plug-ins, which is essentially all of them except xmail and x3mail. You could symlink or copy the plug-in directory contents for all themes in /usr/local/cpanel/base/frontend if you desire.

  7. #7
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    3) Cant modules be created in PHP. The above docs are for Perl Modules. But Fantastico is in PHP with just installation addon_fantastico.cgi in PERL Language !

  8. #8
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Ok, So let me just clear up what I want:
    1) I want to design a plugin that will be installable by any host and will be finally available to the End User
    2) I want to make it in PHP
    3) With PHP I want to get the END USER domains, Mysql info. I meant is that when the END USER Interacts with the PLUGIN, the PLUGIN needs the END USER domains info, Mysql info etc


    I hope I am clear enogh this time!

    I thought Fantastico and ROR are like this
    PLease help me by giving any tutorials and resources!
    Last edited by rongup; 12-31-2008 at 10:46 AM.

  9. #9
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    Ok, So let me just clear up what I want:
    1) I want to design a plugin that will be installable by any host and will be finally available to the End User
    2) I want to make it in PHP
    3) With PHP I want to get the END USER domains, Mysql info

    I hope I am clear enogh this time!

    I thought Fantastico and ROR are like this
    PLease help me by giving any tutorials and resources!
    For that you will want to use one of our PHP Modules, which themselves are simple wrappers around calls to one of our APIs.

  10. #10
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Any guides for that!

    Also for the third point I meant is that when the END USER Interacts with the PLUGIN the PLUGIN needs the END USER domains, Mysql info etc

    I will edit the 3rd point!
    Last edited by rongup; 12-31-2008 at 10:46 AM.

  11. #11
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    Any guides for that!
    The modules themselves are in /usr/local/cpanel/Cpanel

    Other than that, there is the documentation DavidG posted earlier.

  12. #12
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    But the guides are in Perl and nothing in PHP

  13. #13
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Please help me!

  14. #14
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by rongup View Post
    Any guides for that!

    Also for the third point I meant is that when the END USER Interacts with the PLUGIN the PLUGIN needs the END USER domains, Mysql info etc

    I will edit the 3rd point!
    I'm not familiar with building a WHM plug-in in PHP, but information such as the end user's domain and the ability to create MySQL users is available via API1/API2. You can view the source code for the x3 theme to become familiar with these APIs. The code is located at /usr/local/cpanel/base/frontend/x3. The x3 theme is essentially some HTML, CSS, Javascript, YUI (Javascript handling the AJAX) and some API1/API2 calls. If you need help finding a specific API call, let me know.

  15. #15
    Member
    Join Date
    Dec 2008
    Posts
    31

    Default

    Ok i got this file test.php and it had these functions:
    <cpanel PHP="loadvars()">
    <cpanel PHP="loadparkeddomains()">
    <cpanel PHP="loadsubdomains()">
    <cpanel PHP="loaddocroots()">

    What other functions exist ?
    I want MySQL info so that I can connect to MySQL

    Also will a PHP script be allowed to open external files !
    like http://ext-url.com/file.zip

    I want to store that file in the frontend/x3/myplugin/

Similar Threads & Tags
Similar threads

  1. Delete Files/Dirs - API1 and/or API2
    By adelin.feraru in forum cPanel Developers
    Replies: 2
    Last Post: 11-17-2010, 12:00 PM
  2. addforward aPI1 bad args in documentation
    By jcorreia in forum cPanel Developers
    Replies: 2
    Last Post: 03-02-2010, 05:26 AM
  3. XML-API issues with API1 and API2 commands
    By XenomediaBV in forum cPanel Developers
    Replies: 7
    Last Post: 09-14-2009, 12:34 PM
  4. API1 doc?
    By takabanana in forum cPanel Developers
    Replies: 1
    Last Post: 05-20-2009, 05:23 PM
  5. List of all available API1 and API2 modules
    By ck in forum cPanel Developers
    Replies: 1
    Last Post: 04-27-2009, 11:43 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube