Horde_Config::configNoSQL PHP Method

configNoSQL() public method

Subnodes will be parsed and added to both the Horde defaults and the custom configuration parts.
public configNoSQL ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
$switchname string If DomNode is not set, the value of the tag's switchname attribute.
return array An associative array with the SQL configuration tree.
    public function configNoSQL($ctx, $node = null, $switchname = 'driverconfig')
    {
        if ($node) {
            $xpath = new DOMXPath($node->ownerDocument);
        }
        $custom_fields = array('required' => true, 'desc' => 'What database backend should we use?', 'default' => $this->_default($ctx . '|phptype', $node ? $node->getAttribute('default') : ''), 'switch' => array('false' => array('desc' => '[None]', 'fields' => array()), 'mongo' => array('desc' => 'MongoDB', 'fields' => array('hostspec' => array('_type' => 'text', 'required' => false, 'desc' => 'Server specification (format: "mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db"; see http://www.php.net/manual/en/mongoclient.construct.php for further details)', 'default' => $this->_default($ctx . '|hostspec', $node ? $xpath->evaluate('string(configstring[@name="hostspec"])', $node) ?: '' : '')), 'dbname' => array('_type' => 'text', 'required' => false, 'desc' => 'Database name to use', 'default' => $this->_default($ctx . '|dbname', $node ? $xpath->evaluate('string(configstring[@name="dbname"])', $node) ?: '' : ''))))));
        if (isset($node) && $node->getAttribute('baseconfig') == 'true') {
            return $custom_fields;
        }
        list($default, $isDefault) = $this->__default($ctx . '|' . (isset($node) ? $node->getAttribute('switchname') : $switchname), 'horde');
        $config = array('desc' => 'NoSQL driver configuration', 'default' => $default, 'is_default' => $isDefault, 'switch' => array('horde' => array('desc' => 'Horde defaults', 'fields' => array()), 'custom' => array('desc' => 'Custom parameters', 'fields' => array('phptype' => $custom_fields))));
        if (isset($node) && $node->hasChildNodes()) {
            $cur = array();
            $this->_parseLevel($cur, $node->childNodes, $ctx);
            $config['switch']['horde']['fields'] = array_merge($config['switch']['horde']['fields'], $cur);
            $config['switch']['custom']['fields'] = array_merge($config['switch']['custom']['fields'], $cur);
        }
        return $config;
    }