public function getSugarConfig($clearCache = false)
    {
        if ($clearCache) {
            $this->clearConfigCache();
        }
        if (is_null($this->config)) {
            $path = $this->getPath();
            if ($this->isValid() && is_file($path . '/config.php')) {
                require($path . '/config.php');
                if (!isset($sugar_config) || !is_array($sugar_config)) {
                    throw new SugarException("Invalid sugarcrm configuration file at '$path/config.php'");
                }
                if (is_file($path . '/config_override.php')) {
                    require($path . '/config_override.php');
                }
                $this->config = $sugar_config;
            } else {
                throw new SugarException("'$path' is not a valid sugar installation.");
            }
        }

        return $this->config;
    }