Документация по Joomla 1.7

Joomla.Platform\JFactory
libraries/joomla/factory.php at line 17

Class JFactory

JFactory

public abstract class JFactory

Joomla Framework Factory class

Since:
11.1

Field Summary
static mixed

$acl

static mixed

$application

static mixed

$cache

static mixed

$config

static mixed

$database

static mixed

$document

static mixed

$language

static mixed

$mailer

static mixed

$session

Method Summary
static JApplication

getApplication(mixed id, array config, string prefix)

Get a application objectReturns the global JApplication object, only creating it if it doesn't already exist.

static JRegistry

getConfig(string file, string type)

Get a configuration objectReturns the global JRegistry object, only creating it if it doesn't already exist.

static JSession

getSession(array options)

Get a session objectReturns the global JSession object, only creating it if it doesn't already exist.

static JLanguage

getLanguage()

Get a language objectReturns the global JLanguage object, only creating it if it doesn't already exist.

static JDocument

getDocument()

Get a document objectReturns the global JDocument object, only creating it if it doesn't already exist.

static JUser

getUser(integer id)

Get an user objectReturns the global JUser object, only creating it if it doesn't already exist.

static JCache

getCache(string group, string handler, string storage)

Get a cache objectReturns the global JCache object

static JACL

getACL()

Get an authorization objectReturns the global JACL object, only creating it if it doesn't already exist.

static JDatabase

getDbo()

Get a database objectReturns the global JDatabase object, only creating it if it doesn't already exist.

static JMail

getMailer()

Get a mailer objectReturns the global JMail object, only creating it if it doesn't already exist

static mixed

getFeedParser(string url, integer cache_time)

Get a parsed XML Feed Source

static object

getXMLParser(string type, array options)

Get an XML document

static mixed

getXML(string data, boolean isFile)

Reads a XML file.

static JEditor

getEditor(string editor)

Get an editor object

static JURI

getURI(string uri)

Return a reference to the JURI object

static JDate

getDate(mixed time, mixed tzOffset)

Return the JDate object

protected static JRegistry

_createConfig(string file, string type, string namespace)

Create a configuration object

protected static JSession

_createSession(array options)

Create a session object

protected static JDatabase

_createDbo()

Create an database object

protected static JMail

_createMailer()

Create a mailer object

protected static JLanguage

_createLanguage()

Create a language object

protected static JDocument

_createDocument()

Create a document object

static JStream

getStream(boolean use_prefix, boolean use_network, string ua, boolean uamask)

Creates a new stream object with appropriate prefix

Field Detail

libraries/joomla/factory.php at line 25

acl

public static mixed $acl = null

libraries/joomla/factory.php at line 19

application

public static mixed $application = null

libraries/joomla/factory.php at line 20

cache

public static mixed $cache = null

libraries/joomla/factory.php at line 21

config

public static mixed $config = null

libraries/joomla/factory.php at line 26

database

public static mixed $database = null

libraries/joomla/factory.php at line 24

document

public static mixed $document = null

libraries/joomla/factory.php at line 23

language

public static mixed $language = null

libraries/joomla/factory.php at line 27

mailer

public static mixed $mailer = null

libraries/joomla/factory.php at line 22

session

public static mixed $session = null

Method Detail

libraries/joomla/factory.php at line 44

getApplication

public static JApplication getApplication(mixed id, array config, string prefix)

Get a application object

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

Parameters:
id - A client identifier or name.
config - An optional associative array of configuration settings.
prefix - Application prefix
Returns:
object
Since:
11.1
See Also:
JApplication

libraries/joomla/factory.php at line 73

getConfig

public static JRegistry getConfig(string file, string type)

Get a configuration object

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

Parameters:
file - The path to the configuration file
type - The type of the configuration file
Returns:
object
Since:
11.1
See Also:
JRegistry

libraries/joomla/factory.php at line 100

getSession

public static JSession getSession(array options)

Get a session object

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

Parameters:
options - An array containing session options
See Also:
JSession
Returns:
object
Since:
11.1

libraries/joomla/factory.php at line 120

getLanguage

public static JLanguage getLanguage()

Get a language object

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

Returns:
object
Since:
11.1
See Also:
JLanguage

libraries/joomla/factory.php at line 140

getDocument

public static JDocument getDocument()

Get a document object

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

Returns:
object
Since:
11.1
See Also:
JDocument

libraries/joomla/factory.php at line 162

getUser

public static JUser getUser(integer id)

Get an user object

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

Parameters:
id - The user to load - Can be an integer or string - If string, it is converted to ID automatically.
Returns:
object
Since:
11.1
See Also:
JUser

libraries/joomla/factory.php at line 192

getCache

public static JCache getCache(string group, string handler, string storage)

Get a cache object

Returns the global JCache object

Parameters:
group - The cache group name
handler - The handler to use
storage - The storage method
Returns:
object
See Also:
JCache

libraries/joomla/factory.php at line 225

getACL

public static JACL getACL()

Get an authorization object

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

Returns:
object

libraries/joomla/factory.php at line 246

getDbo

public static JDatabase getDbo()

Get a database object

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

Returns:
object
Since:
11.1
See Also:
JDatabase

libraries/joomla/factory.php at line 271

getMailer

public static JMail getMailer()

Get a mailer object

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

Returns:
object
Since:
11.1
See Also:
JMail

libraries/joomla/factory.php at line 290

getFeedParser

public static mixed getFeedParser(string url, integer cache_time)

Get a parsed XML Feed Source

Parameters:
url - url for feed source
cache_time - time to cache feed for (using internal cache mechanism)
Returns:
SimplePie parsed object on success, false on failure
Since:
11.1

libraries/joomla/factory.php at line 330

getXMLParser

public static object getXMLParser(string type, array options)

Get an XML document

Parameters:
type - The type of XML parser needed 'DOM', 'RSS' or 'Simple'
options - ['rssUrl'] the rss url to parse when using "RSS", ['cache_time'] with ' RSS' - feed cache time. If not defined defaults to 3600 sec
Returns:
Parsed XML document object
Since:
11.1
Deprecated:
12.1

libraries/joomla/factory.php at line 372

getXML

public static mixed getXML(string data, boolean isFile)

Reads a XML file.

Parameters:
data - Full path and file name.
isFile - true to load a file or false to load a string.
Returns:
JXMLElement on success or false on error.
Since:
11.1
Todo:
This may go in a separate class - error reporting may be improved.
See Also:
JXMLElement

libraries/joomla/factory.php at line 412

getEditor

public static JEditor getEditor(string editor)

Get an editor object

Parameters:
editor - The editor to load, depends on the editor plugins that are installed
Returns:
object

libraries/joomla/factory.php at line 435

getURI

public static JURI getURI(string uri)

Return a reference to the JURI object

Parameters:
uri - uri name
Returns:
object
Since:
11.1
See Also:
JURI

libraries/joomla/factory.php at line 453

getDate

public static JDate getDate(mixed time, mixed tzOffset)

Return the JDate object

Parameters:
time - The initial time for the JDate object
tzOffset - The timezone offset.
Returns:
object
Since:
11.1
See Also:
JDate

libraries/joomla/factory.php at line 511

_createConfig

protected static JRegistry _createConfig(string file, string type, string namespace)

Create a configuration object

Parameters:
file - The path to the configuration file.
type - The type of the configuration file.
namespace - The namespace of the configuration file.
Since:
11.1
See Also:
JRegistry

libraries/joomla/factory.php at line 548

_createSession

protected static JSession _createSession(array options)

Create a session object

Parameters:
options - An array containing session options
Returns:
object
Since:
11.1

libraries/joomla/factory.php at line 575

_createDbo

protected static JDatabase _createDbo()

Create an database object

Returns:
object
Since:
11.1
See Also:
JDatabase

libraries/joomla/factory.php at line 615

_createMailer

protected static JMail _createMailer()

Create a mailer object

Returns:
object
Since:
11.1
See Also:
JMail

libraries/joomla/factory.php at line 665

_createLanguage

protected static JLanguage _createLanguage()

Create a language object

Returns:
object
Since:
11.1
See Also:
JLanguage

libraries/joomla/factory.php at line 685

_createDocument

protected static JDocument _createDocument()

Create a document object

Returns:
object
Since:
11.1
See Also:
JDocument

libraries/joomla/factory.php at line 719

getStream

public static JStream getStream(boolean use_prefix, boolean use_network, string ua, boolean uamask)

Creates a new stream object with appropriate prefix

Parameters:
use_prefix - Prefix the connections for writing
use_network - Use network if available for writing; use false to disable (e.g. FTP, SCP)
ua - UA User agent to use
uamask - User agent masking (prefix Mozilla)
Since:
11.1
See Also:
JStream

Документация по Joomla 1.7