Actions

Difference between revisions of "JApplication/getCfg"

From Joomla! Documentation

(New page: {{review}} ===Syntax=== ''mixed'' getCfg ($varname) === Parameters === {| class="wikitable" !Argument !Data type !Description !Default |- |$varname |string |The name of the value to ...)
 
Line 40: Line 40:
 
|Type of Database beeing used. For example <nowiki>'mysql'</nowiki>
 
|Type of Database beeing used. For example <nowiki>'mysql'</nowiki>
 
|-
 
|-
|host
+
|user
|Database Host. For example 'localhost'.
+
|Database user. For example 'root'.
 
|-
 
|-
|dbtype
+
|db
|string
+
|Name of the database, where the Joomla tables are stored. For example 'joomla'.
 
|-
 
|-
|dbtype
+
|dbprefix
|string
+
|Prefix of all database tables that are used by joomla. For example 'jos_'
 
|-
 
|-
|dbtype
+
|ftp_host
|string
+
|FTP Host used by Joomla. For example 'localhost'.
 
|-
 
|-
|dbtype
+
|ftp_port
|string
+
|FTP Port used by Joomla.
 
|-
 
|-
|dbtype
+
|ftp_user
|string
+
|FTP user used by Joomla.
 
|-
 
|-
|dbtype
+
|ftp_pass
|string
+
|FTP Password.
 
|-
 
|-
|dbtype
+
|ftp_root
|string
+
|
 
|-
 
|-
|dbtype
+
|ftp_enable
|string
+
|1 if FTP operations are enabled. Else 0
 
|-
 
|-
|dbtype
+
|tmp_path
|string
+
|Path to the temporary folder of Joomla. Usually the /tmp folder
 
|-
 
|-
|dbtype
+
|log_path
|string
+
|Path to the log folder of Joomla. Usually the /logs folder
 
|-
 
|-
|dbtype
+
|mailer
|string
+
|The mailer that is used for the delivery of site-emails.
 
|-
 
|-
|dbtype
+
|mailfrom
|string
+
|The email address that will be used to send the site-emails from.
 
|-
 
|-
|dbtype
+
|sendmail
|string
+
|Path to the sendmail program directory on the host server
 
|-
 
|-
|dbtype
+
|smtpauth
|string
+
|1 if SMTP Host requires authentification. Else 0
 
|-
 
|-
|dbtype
+
|smtpuser
|string
+
|SMTP user
 
|-
 
|-
|dbtype
+
|smtppass
|string
+
|SMTP password
 
|-
 
|-
|dbtype
+
|smtphost
|string
+
|SMTP host
 
|-
 
|-
|dbtype
+
|debug
|string
+
|1 if debug modus is enabled. Else 0
 
|-
 
|-
|dbtype
+
|caching
|string
+
|1 if caching is enabled. Else 0
 
|-
 
|-
|dbtype
+
|cachetime
|string
+
|maximum time of a cache file to be stored before its refreshed
 
|-
 
|-
|dbtype
+
|language
|string
+
|
 
|-
 
|-
|dbtype
+
|secret
|string
+
|The secret word
 
|-
 
|-
|dbtype
+
|editor
|string
+
|The default editor defined in the Global Configuratins. For example 'tinymce'
 
|-
 
|-
|dbtype
+
|offset
|string
+
|
 
|-
 
|-
|dbtype
+
|lifetime
|string
+
|The session-lifetime
 
|-
 
|-
|dbtype
+
|offline
|string
+
|1 if the site status is 'offline', and thus access via the front-end is not possible. Else 0.
 
|-
 
|-
|dbtype
+
|list_limit
|string
+
|Default lenght of lists. In general this means the number of records to be shown in a list.
 
|-
 
|-
|dbtype
+
|helpurl
|string
+
|The URL to the selected Help Server
 
|-
 
|-
|dbtype
+
|debug_lang
|string
+
|1 if the Language is supposed to be debugged. Else 0.
 
|-
 
|-
|dbtype
+
|sef
|string
+
|1 if search engine friendly URLs are activated. Else 0.
 
|-
 
|-
|dbtype
+
|sef_rewrite
|string
+
|1 if Apache ''mod_rewrite'' is used. Else 0.
 
|-
 
|-
|dbtype
+
|sef_suffix
|string
+
|1 if the system adds a suffix to the url based on the document type.
 
|-
 
|-
|dbtype
+
|feed_limit
|string
+
|Number of content-items to show in the feeds
 
|-
 
|-
|dbtype
+
|gzip
|string
+
|
 
|-
 
|-
|dbtype
+
|error_reporting
|string
+
|Error-Reporting Value
 
|-
 
|-
|dbtype
+
|xmlrpc_server
|string
+
|
 
|-
 
|-
|dbtype
+
|live_site
|string
+
|
 
|-
 
|-
|dbtype
+
|cache_handler
|string
+
|The cache handler that is set in the Global Configurations. For example 'file'.
 
|-
 
|-
|dbtype
+
|memcache_settings
|string
+
|
 
|-
 
|-
|dbtype
+
|MetaAuthor
|string
+
|1 if the Author Meta Tag is supposed to be showed when viewing articles. Else 0
 
|-
 
|-
|dbtype
+
|MetaTitle
|string
+
|1 if the Title Meta Tag is supposed to be showed when viewing articles. Else 0
 
|-
 
|-
|dbtype
+
|session_handler
|string
+
|The session-handler used by Joomla. For example 'database'.
 
|-
 
|-
|dbtype
+
|sitename
|string
+
|The name of the Joomla Site. For example 'Joomla!'
 
|-
 
|-
|dbtype
+
|MetaDesc
|string
+
|The Global Meta Description used for the site.
 
|-
 
|-
|dbtype
+
|MetaKeys
|string
+
|Global site keywords
 
|-
 
|-
|dbtype
+
|offline_message
|string
+
|The offline message defined in Global Configurations.
|-
+
|dbtype
+
|string
+
|-
+
|dbtype
+
|string
+
|-
+
|dbtype
+
|string
+
 
|}
 
|}
  
 +
===See also===
  
===See also===
 
* [[JTable/load]]
 
* [[JTable/store]]
 
* [[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface#Creating the Table Class | Creating a JTable Child Class (MVC Tutorial Part 4)]]
 
 
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JApplication]]</noinclude>
 
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JApplication]]</noinclude>

Revision as of 08:23, 29 November 2008

Copyedit.png
This Article Needs Your Help

This article is tagged because it NEEDS REVIEW. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.


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.

See also