JApplication/getCfg
From Joomla! Documentation
| This recently added article requires a review |
Contents |
Syntax
mixed getCfg ($varname)
Parameters
| Argument | Data type | Description | Default |
|---|---|---|---|
| $varname | string | The name of the value to get. |
Returns
Returns the value of the configuration-property that has been specified by $varname.
Description
JApplication::getCfg allows you to get a specific configuration value that has been specified via Global Configurations in the Admin-Interface.
Example
Let's say we want to get the url to the Help Server that we have specified in the Global Configurations:
$mainframe = JFactory::getApplication(); echo $mainframe->getCfg('helpurl'); // OUTPUT: http://help.joomla.org
Config Properties
This is a list of configuration properties that can be received via JApplication::getCfg. The list might be incomplete:
| $varname | Description |
|---|---|
| dbtype | Type of Database beeing used. For example 'mysql' |
| user | Database user. For example 'root'. |
| db | Name of the database, where the Joomla tables are stored. For example 'joomla'. |
| dbprefix | Prefix of all database tables that are used by joomla. For example 'jos_' |
| ftp_host | FTP Host used by Joomla. For example 'localhost'. |
| ftp_port | FTP Port used by Joomla. |
| ftp_user | FTP user used by Joomla. |
| ftp_pass | FTP Password. |
| ftp_root | |
| ftp_enable | 1 if FTP operations are enabled. Else 0 |
| tmp_path | Path to the temporary folder of Joomla. Usually the /tmp folder |
| log_path | Path to the log folder of Joomla. Usually the /logs folder |
| mailer | The mailer that is used for the delivery of site-emails. |
| mailfrom | The email address that will be used to send the site-emails from. |
| sendmail | Path to the sendmail program directory on the host server |
| smtpauth | 1 if SMTP Host requires authentification. Else 0 |
| smtpuser | SMTP user |
| smtppass | SMTP password |
| smtphost | SMTP host |
| debug | 1 if debug modus is enabled. Else 0 |
| caching | 1 if caching is enabled. Else 0 |
| cachetime | maximum time of a cache file to be stored before its refreshed |
| language | |
| secret | The secret word |
| editor | The default editor defined in the Global Configuratins. For example 'tinymce' |
| offset | |
| lifetime | The session-lifetime |
| offline | 1 if the site status is 'offline', and thus access via the front-end is not possible. Else 0. |
| list_limit | Default lenght of lists. In general this means the number of records to be shown in a list. |
| helpurl | The URL to the selected Help Server |
| debug_lang | 1 if the Language is supposed to be debugged. Else 0. |
| sef | 1 if search engine friendly URLs are activated. Else 0. |
| sef_rewrite | 1 if Apache mod_rewrite is used. Else 0. |
| sef_suffix | 1 if the system adds a suffix to the url based on the document type. |
| feed_limit | Number of content-items to show in the feeds |
| gzip | |
| error_reporting | Error-Reporting Value |
| xmlrpc_server | |
| live_site | |
| cache_handler | The cache handler that is set in the Global Configurations. For example 'file'. |
| memcache_settings | |
| MetaAuthor | 1 if the Author Meta Tag is supposed to be showed when viewing articles. Else 0 |
| MetaTitle | 1 if the Title Meta Tag is supposed to be showed when viewing articles. Else 0 |
| session_handler | The session-handler used by Joomla. For example 'database'. |
| sitename | The name of the Joomla Site. For example 'Joomla!' |
| MetaDesc | The Global Meta Description used for the site. |
| MetaKeys | Global site keywords |
| offline_message | The offline message defined in Global Configurations. |
