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;
            }

        }

    }
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;
            }

        }

    }
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 ; } } }
Parses the config file

@param   string    $file     The config file. Just pass so we don't have
to keep it around in a var
Parses the config file