Making new cPanel module
So far, after reading documentation, I was able to create a module icon and upon selecting it, I was able to access my custom code shown below and the correct output was displayed.
[PHP]
include("/usr/local/cpanel/php/cpanel.php");
$cpanel = new CPANEL();
echo "This option is very new and will be available way later. Sorry.
"; echo "Testing... hostname: ".$cpanel->cpanelprint('$hostname')."
"; echo "Testing... host: ".$cpanel->cpanelprint('$httphost')."
"; echo "Testing... main: ".$cpanel->cpanelprint('$basedir')."
"; echo "Testing... userf: ".$cpanel->cpanelprint('$homedir')."
"; echo "Testing... user: ".$cpanel->cpanelprint('$user')."
"; $cpanel->end(); [/PHP] Now I'm curious as to how to modify the main apache config file within my module. Is there a way I can do this without having to resort to traditional php file I/O functions (like avoiding fopen() etc)?
"; echo "Testing... hostname: ".$cpanel->cpanelprint('$hostname')."
"; echo "Testing... host: ".$cpanel->cpanelprint('$httphost')."
"; echo "Testing... main: ".$cpanel->cpanelprint('$basedir')."
"; echo "Testing... userf: ".$cpanel->cpanelprint('$homedir')."
"; echo "Testing... user: ".$cpanel->cpanelprint('$user')."
"; $cpanel->end(); [/PHP] Now I'm curious as to how to modify the main apache config file within my module. Is there a way I can do this without having to resort to traditional php file I/O functions (like avoiding fopen() etc)?
-
]Now I'm curious as to how to modify the main apache config file within my module. Is there a way I can do this without having to resort to traditional php file I/O functions (like avoiding fopen() etc)?
Hello :) There's no API to manage Apache configuration data at this time, so you would have to update your script to manually modify individual files. EX: How to manually edit Apache features Thank you.0
Please sign in to leave a comment.
Comments
1 comment