public function setParams($data, $section = null)
    {
        if ($section) {
            $newData = array($section => $data);
            $data    = $newData;
            unset($newData);
        }

        if (isset($data['errors']['reporting'])) {
            $this->showErrors($data['errors']['reporting']);
        }

        // set root directory
        if (!isset($data['root']) && !self::$_config['root']) {
            $data['root'] = $_SERVER['DOCUMENT_ROOT'];
        }

        // set log path
        if (isset($data['log']['path']) && $data['log']['path']) {
            $this->_logPath = $data['log']['path'];

        } elseif (!self::$_config['log']['path'] || !$this->_logPath) {
            $this->_logPath = dirname(__FILE__) . self::DS . 'logs';
        }

        // set log filename
        $logFile = 'jbdump';
        if (isset($data['log']['file']) && $data['log']['file']) {
            $logFile = $data['log']['file'];

        } elseif (!self::$_config['log']['file'] || !$this->_logfile) {
            $logFile = 'jbdump';
        }

        $this->_logfile = $this->_logPath . self::DS . $logFile . '_' . date('Y.m.d') . '.log.php';

        // merge new params with of config
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                foreach ($value as $keyInner => $valueInner) {
                    if (!isset(self::$_config[$key])) {
                        self::$_config[$key] = array();
                    }
                    self::$_config[$key][$keyInner] = $valueInner;
                }
            } else {
                self::$_config[$key] = $value;
            }
        }

        return $this;
    }