english/libraries/joomla/factory.php
/**
	 * Create a configuration object
	 *
	 * @param   string  $file       The path to the configuration file.
	 * @param   string  $type       The type of the configuration file.
	 * @param   string  $namespace  The namespace of the configuration file.
	 *
	 * @return  JRegistry
	 * @since   11.1
	 *
	 * @see JRegistry
	 */
Create a configuration object
@param   string  $file       The path to the configuration file.
@param   string  $type       The type of the configuration file.
@param   string  $namespace  The namespace of the configuration file.




Create a configuration object @param string $file The path to the configuration file . @param string $type The type of the configuration file . @param string $namespace The namespace of the configuration file .
protected static function _createConfig($file, $type = 'PHP', $namespace = '')
	{
		jimport('joomla.registry.registry');
		if (is_file($file)) {
			include_once $file;
		}
		$registry = new JRegistry();
		$namespace = ucfirst((string) preg_replace('/[^A-Z_]/i', '', $namespace));
		$name = 'JConfig'.$namespace;
		if ($type == 'PHP' && class_exists($name)) {
			$config = new $name();
			$registry->loadObject($config);
		}
		return $registry;
	}
protected static function _createConfig ( $ file , $ type = 'PHP' , $ namespace = '' ) { jimport ( 'joomla.registry.registry' ) ; if ( is_file ( $ file ) ) { include_once $ file ; } $ registry = new JRegistry ( ) ; $ namespace = ucfirst ( ( string ) preg_replace ( '/[^A-Z_]/i' , '' , $ namespace ) ) ; $ name = 'JConfig' . $ namespace ; if ( $ type == 'PHP' && class_exists ( $ name ) ) { $ config = new $ name ( ) ; $ registry -> loadObject ( $ config ) ; } return $ registry ; }
Create a configuration object
 @param   string  $file       The path to the configuration file.
Create a configuration object @param string $file The path to the configuration file .
// Create the registry with a default namespace of config // Sanitize the namespace. // Build the config name. // Handle the PHP configuration type. // Create the JConfig object // Load the configuration values into the registry