class JFactory


Located at : UKNOWVA_ROOT/libraries/joomla/factory.php

Joomla Framework Factory class

Properties

static $application
static $cache
static $config
static $session
static $language
static $document
static $acl
static $database
static $mailer

Methods

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

Get a application object

static JRegistry
getConfig(string $file = null, string $type = 'PHP')

Get a configuration object

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

Get a session object

static JLanguage
getLanguage()

Get a language object

static JDocument
getDocument()

Get a document object

static JUser
getUser($id = null, $username_as_identifier = false)

Get an user object

static JCache
getCache(string $group = '', string $handler = 'callback', string $storage = null)

Get a cache object

static JACL
getACL()

Get an authorization object

static JDatabase
getDbo()

Get a database object

static JMail
getMailer()

Get a mailer object

static mixed
getFeedParser(string $url, integer $cache_time)

Get a parsed XML Feed Source

static object
getXMLParser(string $type = '', array $options = array()) deprecated

Get an XML document

static mixed
getXML(string $data, boolean $isFile = true)

Reads a XML file.

static JEditor
getEditor(string $editor = null)

Get an editor object

static JURI
getURI(string $uri = 'SERVER')

Return a reference to the {@link JURI} object

static JDate
getDate(mixed $time = 'now', mixed $tzOffset = null)

Return the {@link JDate} object

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

Creates a new stream object with appropriate prefix

Details

at line 44
static JApplication getApplication(mixed $id = null, array $config = array(), string $prefix = 'J')

Get a application object

Returns the global {@link JApplication} object, only creating it if it doesn't already exist.

Parameters

mixed $id A client identifier or name.
array $config An optional associative array of configuration settings.
string $prefix Application prefix

Return Value

JApplication object

See also

JApplication

at line 73
static JRegistry getConfig(string $file = null, string $type = 'PHP')

Get a configuration object

Returns the global {@link JRegistry} object, only creating it if it doesn't already exist.

Parameters

string $file The path to the configuration file
string $type The type of the configuration file

Return Value

JRegistry object

at line 100
static JSession getSession(array $options = array())

Get a session object

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

Parameters

array $options An array containing session options

Return Value

JSession object

See also

JSession

at line 120
static JLanguage getLanguage()

Get a language object

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

Return Value

JLanguage object

See also

JLanguage

at line 140
static JDocument getDocument()

Get a document object

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

Return Value

JDocument object

See also

JDocument

at line 162
static JUser getUser($id = null, $username_as_identifier = false)

Get an user object

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

Parameters

$id
$username_as_identifier

Return Value

JUser object

See also

JUser

at line 192
static JCache getCache(string $group = '', string $handler = 'callback', string $storage = null)

Get a cache object

Returns the global {@link JCache} object

Parameters

string $group The cache group name
string $handler The handler to use
string $storage The storage method

Return Value

JCache object

See also

JCache

at line 225
static JACL getACL()

Get an authorization object

Returns the global {@link JACL} object, only creating it if it doesn't already exist.

Return Value

JACL object

at line 246
static JDatabase getDbo()

Get a database object

Returns the global {@link JDatabase} object, only creating it if it doesn't already exist.

Return Value

JDatabase object

See also

JDatabase

at line 271
static JMail getMailer()

Get a mailer object

Returns the global {@link JMail} object, only creating it if it doesn't already exist

Return Value

JMail object

See also

JMail

at line 290
static mixed getFeedParser(string $url, integer $cache_time)

Get a parsed XML Feed Source

Parameters

string $url url for feed source
integer $cache_time time to cache feed for (using internal cache mechanism)

Return Value

mixed SimplePie parsed object on success, false on failure

at line 330
static object getXMLParser(string $type = '', array $options = array()) deprecated

deprecated 12.1

Get an XML document

Parameters

string $type The type of XML parser needed 'DOM', 'RSS' or 'Simple'
array $options ['rssUrl'] the rss url to parse when using "RSS", ['cache_time'] with ' RSS' - feed cache time. If not defined defaults to 3600 sec

Return Value

object Parsed XML document object

at line 372
static mixed getXML(string $data, boolean $isFile = true)

Reads a XML file.

Parameters

string $data Full path and file name.
boolean $isFile true to load a file or false to load a string.

Return Value

mixed JXMLElement on success or false on error.

See also

JXMLElement

at line 412
static JEditor getEditor(string $editor = null)

Get an editor object

Parameters

string $editor The editor to load, depends on the editor plugins that are installed

Return Value

JEditor object

at line 435
static JURI getURI(string $uri = 'SERVER')

Return a reference to the {@link JURI} object

Parameters

string $uri uri name

Return Value

JURI object

See also

JURI

at line 453
static JDate getDate(mixed $time = 'now', mixed $tzOffset = null)

Return the {@link JDate} object

Parameters

mixed $time The initial time for the JDate object
mixed $tzOffset The timezone offset.

Return Value

JDate object

See also

JDate

at line 743
static JStream getStream(boolean $use_prefix = true, boolean $use_network = true, string $ua = null, boolean $uamask = false)

Creates a new stream object with appropriate prefix

Parameters

boolean $use_prefix Prefix the connections for writing
boolean $use_network Use network if available for writing; use false to disable (e.g. FTP, SCP)
string $ua UA User agent to use
boolean $uamask User agent masking (prefix Mozilla)

Return Value

JStream

See also

JStream