JFactory

Joomla Platform Factory class.

abstract
since

11.1

package

Joomla.Platform

Methods

createConfig

Create a configuration object

createConfig(string $file, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
static
see \Registry
since

11.1

Arguments

$file

stringThe path to the configuration file.

$type

stringThe type of the configuration file.

$namespace

stringThe namespace of the configuration file.

Response

\Joomla\Registry\Registry

createDbo

Create an database object

createDbo() : \JDatabaseDriver
static
see \JDatabaseDriver
since

11.1

Response

\JDatabaseDriver

createDocument

Create a document object

createDocument() : \JDocument
static
see \JDocument
since

11.1

Response

\JDocumentobject

createLanguage

Create a language object

createLanguage() : \JLanguage
static
see \JLanguage
since

11.1

Response

\JLanguageobject

createMailer

Create a mailer object

createMailer() : \JMail
static
see \JMail
since

11.1

Response

\JMailobject

createSession

Create a session object

createSession(array $options = array()) : \JSession
static
since

11.1

Arguments

$options

arrayAn array containing session options

Response

\JSessionobject

getAcl

Get an authorization object

getAcl() : \JAccess
static deprecated

Returns the global JAccess object, only creating it if it doesn't already exist.

deprecated

13.3 (Platform) & 4.0 (CMS) - Use JAccess directly.

Response

\JAccessobject

getApplication

Get an application object.

getApplication(mixed $id = null, array $config = array(), string $prefix = 'J') : \JApplicationCms
static

Returns the global JApplicationCms object, only creating it if it doesn't already exist.

see \JApplication
since

11.1

throws

\Exception

Arguments

$id

mixedA client identifier or name.

$config

arrayAn optional associative array of configuration settings.

$prefix

stringApplication prefix

Response

\JApplicationCmsobject

getCache

Get a cache object

getCache(string $group = '', string $handler = 'callback', string $storage = null) : \JCacheController
static

Returns the global JCacheController object

see \JCache
since

11.1

Arguments

$group

stringThe cache group name

$handler

stringThe handler to use

$storage

stringThe storage method

Response

\JCacheControllerobject

getConfig

Get a configuration object

getConfig(string $file = null, string $type = 'PHP', string $namespace = '') : \Joomla\Registry\Registry
static

Returns the global \JConfig object, only creating it if it doesn't already exist.

see \Registry
since

11.1

Arguments

$file

stringThe path to the configuration file

$type

stringThe type of the configuration file

$namespace

stringThe namespace of the configuration file

Response

\Joomla\Registry\Registry

getDate

Return the {@link JDate} object

getDate(mixed $time = 'now', mixed $tzOffset = null) : \JDate
static
see \JDate
since

11.1

Arguments

$time

mixedThe initial time for the JDate object

$tzOffset

mixedThe timezone offset.

Response

\JDateobject

getDbo

Get a database object.

getDbo() : \JDatabaseDriver
static

Returns the global JDatabaseDriver object, only creating it if it doesn't already exist.

see \JDatabaseDriver
since

11.1

Response

\JDatabaseDriver

getDocument

Get a document object.

getDocument() : \JDocument
static

Returns the global JDocument object, only creating it if it doesn't already exist.

see \JDocument
since

11.1

Response

\JDocumentobject

getEditor

Get an editor object.

getEditor(string $editor = null) : \JEditor
static deprecated
since

11.1

throws

\BadMethodCallException

deprecated

12.3 (Platform) & 4.0 (CMS) - Use JEditor directly

Arguments

$editor

stringThe editor to load, depends on the editor plugins that are installed

Response

\JEditorinstance of JEditor

getFeedParser

Get a parsed XML Feed Source

getFeedParser(string $url, integer $cache_time) : mixed
static deprecated
since

11.1

throws

\BadMethodCallException

deprecated

4.0 Use directly JFeedFactory or supply SimplePie instead. Mehod will be proxied to JFeedFactory beginning in 3.2

Arguments

$url

stringUrl for feed source.

$cache_time

integerTime to cache feed for (using internal cache mechanism).

Response

mixedSimplePie parsed object on success, false on failure.

getLanguage

Get a language object.

getLanguage() : \JLanguage
static

Returns the global JLanguage object, only creating it if it doesn't already exist.

see \JLanguage
since

11.1

Response

\JLanguageobject

getMailer

Get a mailer object.

getMailer() : \JMail
static

Returns the global JMail object, only creating it if it doesn't already exist.

see \JMail
since

11.1

Response

\JMailobject

getSession

Get a session object.

getSession(array $options = array()) : \JSession
static

Returns the global JSession object, only creating it if it doesn't already exist.

see \JSession
since

11.1

Arguments

$options

arrayAn array containing session options

Response

\JSessionobject

getStream

Creates a new stream object with appropriate prefix

getStream(boolean $use_prefix = true, boolean $use_network = true, string $ua = null, boolean $uamask = false) : \JStream
static
see \JStream
since

11.1

Arguments

$use_prefix

booleanPrefix the connections for writing

$use_network

booleanUse network if available for writing; use false to disable (e.g. FTP, SCP)

$ua

stringUA User agent to use

$uamask

booleanUser agent masking (prefix Mozilla)

Response

\JStream

getUri

Return a reference to the {@link JUri} object

getUri(string $uri = 'SERVER') : \JUri
static deprecated
see \JUri
since

11.1

deprecated

13.3 (Platform) & 4.0 (CMS) - Use JUri directly.

Arguments

$uri

stringUri name.

Response

\JUriobject

getUser

Get a user object.

getUser(integer $id = null) : \JUser
static

Returns the global JUser object, only creating it if it doesn't already exist.

see \JUser
since

11.1

Arguments

$id

integerThe user to load - Can be an integer or string - If string, it is converted to ID automatically.

Response

\JUserobject

getXml

Reads a XML file.

getXml(string $data, boolean $isFile = true) : mixed
static deprecated
see \JXMLElement
since

11.1

note

When JXMLElement is not present a SimpleXMLElement will be returned.

deprecated

13.3 (Platform) & 4.0 (CMS) - Use SimpleXML directly.

Arguments

$data

stringFull path and file name.

$isFile

booleantrue to load a file or false to load a string.

Response

mixedJXMLElement or SimpleXMLElement on success or false on error.

Properties

application

Global application object

static
since

11.1

Type(s)

\JApplicationCms

cache

Global cache object

static
since

11.1

Type(s)

\JCache

config

Global configuraiton object

static
since

11.1

Type(s)

\JConfig

dates

Container for JDate instances

static
since

11.3

Type(s)

array

session

Global session object

static
since

11.1

Type(s)

\JSession

language

Global language object

static
since

11.1

Type(s)

\JLanguage

document

Global document object

static
since

11.1

Type(s)

\JDocument

acl

Global ACL object

static deprecated
since

11.1

deprecated

13.3 (Platform) & 4.0 (CMS)

Type(s)

\JAccess

database

Global database object

static
since

11.1

Type(s)

\JDatabaseDriver

mailer

Global mailer object

static
since

11.1

Type(s)

\JMail