protected function parse_config($file) {

        $this->log("Loading configuration from $file");

        if (substr($file, -4) == ".php") {

            require $file;

        } elseif (substr($file, -4) == ".ini") {

            $gearman_config = parse_ini_file($file, true);

        }

        if (empty($gearman_config)) {
            $this->show_help("No configuration found in $file");
        }

        if (isset($gearman_config[self::DEFAULT_CONFIG])) {
            $this->config = $gearman_config[self::DEFAULT_CONFIG];
            $this->config['functions'] = array();
        }

        foreach ($gearman_config as $function=>$data) {

            if (strcasecmp($function, self::DEFAULT_CONFIG) != 0) {
                $this->config['functions'][$function] = $data;
            }

        }

    }