Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

OptimizeWS Module Documentation

Allows a user to tweak settings such as gzip http compression

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

OptimizeWS::loadoptimizesettings

API Version: 1 - Click here for documentation
Syntax: OptimizeWS::loadoptimizesettings( )
Description: This function sets relevant environment variables for the Optimize function. By default, it sets:
  • $ENV{'deflate_selected'} = 'disabled'
  • $ENV{'deflate_mime_list'} = 'text/html text/plain text/xml'

If there are mod_deflate rules in the account's .htaccess file, the function attempts to parse them and change $ENV{'deflate_selected'} = 'list' and $ENV{'deflate_mime_list'}. These will be set to the list of filetypes currently being compressed.

The function will also cause $ENV{'optimize_apache_version'} to be set to the Apache version (e.g., 2.2).

Returns:  
 
This function does not produce any output.

OptimizeWS::optimizews

API Version: 1 - Click here for documentation
Syntax: OptimizeWS::optimizews( deflate_selection, deflate_mime_list )
Description: Configure mod_deflate for the cPanel account.
Parameters:  
  deflate_selection (string)
  Acceptable values include:
* all - Compress all file types before they are served.
* disabled - Disable mod_deflate.
* list - Causes only MIME types listed in $deflate_mime_list to be compressed before they are served.
.
  deflate_mime_list (string)
  A list of MIME types to compress before serving when $deflate_selection is set to list (e.g., text/html, text/plain, or text/xml).
Returns:  
 
This function does not produce any output.

OptimizeWS::loadoptimizesettings

API Version: 1 - Click here for documentation
Syntax: OptimizeWS::loadoptimizesettings( bytes )
Description: Print the remaining disk quota space in megabytes (MB).
Parameters:  
  bytes (boolean (optional))
  Setting this parameter to 1 prints the value in bytes.
Returns:  
 
The output will contain a value such as:
401.33

Topic revision: r2 - 27 Mar 2012 - 19:09:31 - Main.JenniferDoubrava