#1 (permalink)  
Old 12-30-2008, 05:06 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-30-2008, 10:42 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
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.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-30-2008, 11:05 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-30-2008, 11:11 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
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
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-30-2008, 12:39 PM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-30-2008, 12:43 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
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.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-30-2008, 12:51 PM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-31-2008, 10:16 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-31-2008, 10:31 AM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-31-2008, 10:42 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 12-31-2008, 10:51 AM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 12-31-2008, 10:52 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
But the guides are in Perl and nothing in PHP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 01-03-2009, 02:39 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
Please help me!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 01-05-2009, 12:09 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
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.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 01-08-2009, 04:16 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc