Source for file provider.php
Documentation is available at provider.php
* @package FrameworkOnFramework
* @copyright Copyright (c)2010-2012 Nicholas K. Dionysopoulos
* @license GNU General Public License version 2, or later
* Reads and parses the fof.xml file in the back-end of a FOF-powered component,
* provisioning the data to the rest of the FOF framework
* @package FrameworkOnFramework
* Cache of FOF components' configuration variables
public static $configurations =
array();
* Parses the configuration of the specified component
* @param string $component The name of the component, e.g. com_foobar
* @param boolean $force Force reload even if it's already parsed?
if (!$force && isset
(self::$configurations[$component]))
if (FOFPlatform::getInstance()->isCli())
$order =
array('cli', 'backend');
$order =
array('backend');
$order =
array('frontend');
self::$configurations[$component] =
array();
foreach ($order as $area)
self::$configurations[$component] =
array_merge_recursive(self::$configurations[$component], $config);
* Returns the value of a variable. Variables use a dot notation, e.g.
* view.config.whatever where the first part is the domain, the rest of the
* parts specify the path to the variable.
* @param string $variable The variable name
* @param mixed $default The default value, or null if not specified
* @return mixed The value of the variable
public function get($variable, $default =
null)
$domains =
$this->getDomains();
list
($component, $domain, $var) =
explode('.', $variable, 3);
if (!isset
(self::$configurations[$component]))
if (!in_array($domain, $domains))
$class =
'FOFConfigDomain' .
ucfirst($domain);
return $o->get(self::$configurations[$component], $var, $default);
* Parses the configuration options of a specific component area
* @param string $component Which component's cionfiguration to parse
* @param string $area Which area to parse (frontend, backend, cli)
* @return array A hash array with the configuration data
// Initialise the return array
// Get the folders of the component
$componentPaths =
FOFPlatform::getInstance()->getComponentBaseDirs($component);
// Check that the path exists
$path =
$componentPaths['admin'];
// Read the filename if it exists
$filename =
$path .
'/fof.xml';
// Load the XML data in a SimpleXMLElement object
if (!($xml instanceof
SimpleXMLElement))
$areaData =
$xml->xpath('//' .
$area);
// Parse individual configuration domains
foreach ($domains as $dom)
$class =
'FOFConfigDomain' .
ucfirst($dom);
$o->parseDomain($xml, $ret);
// Finally, return the result
* Gets a list of the available configuration domain adapters
* @return array A list of the available domains
static $domains =
array();
JLoader::import('joomla.filesystem.folder');
foreach ($files as $file)
if ($domain ==
'interface')
Documentation generated on Tue, 19 Nov 2013 15:11:21 +0100 by phpDocumentor 1.4.3