protected function parseConfig($config, $defaults)
    {
        if (array_key_exists('config', $config)) {
            $configFileData = Resque::readConfigFile($config['config']);

            foreach ($config as $key => &$value) {
                // If the config value is equal to the default value set in the command then
                // have a look at the config file. This is so that the config options can be
                // over-ridden in the command line.
                if (
                    isset($this->configOptionMap[$key]) and
                    (
                        ($key === 'verbose' or $value === $defaults[$key]) and
                        (false !== Util::path($configFileData, $this->configOptionMap[$key], $found))
                    )
                ) {
                    switch ($key) {
                        // Need to make sure the log handlers are in the correct format
                        case 'log':
                            $value = array();
                            foreach ((array)$found as $handler => $target) {
                                $handler = strtolower($handler);

                                if ($target !== true) {
                                    $handler .= ':';

                                    if (in_array($handler, array('redis:', 'mongodb:', 'couchdb:', 'amqp:'))) {
                                        $handler .= '//';
                                    }

                                    $handler .= $target;
                                }

                                $value[] = $handler;
                            }

                            break;
                        default:
                            $value = $found;
                            break;
                    }
                }
            }

            $this->config = $config;

            return true;
        }

        return false;
    }
protected function parseConfig($config, $defaults)
    {
        if (array_key_exists('config', $config)) {
            $configFileData = Resque::readConfigFile($config['config']);

            foreach ($config as $key => &$value) {
                // If the config value is equal to the default value set in the command then
                // have a look at the config file. This is so that the config options can be
                // over-ridden in the command line.
                if (
                    isset($this->configOptionMap[$key]) and
                    (
                        ($key === 'verbose' or $value === $defaults[$key]) and
                        (false !== Util::path($configFileData, $this->configOptionMap[$key], $found))
                    )
                ) {
                    switch ($key) {
                        // Need to make sure the log handlers are in the correct format
                        case 'log':
                            $value = array();
                            foreach ((array)$found as $handler => $target) {
                                $handler = strtolower($handler);

                                if ($target !== true) {
                                    $handler .= ':';

                                    if (in_array($handler, array('redis:', 'mongodb:', 'couchdb:', 'amqp:'))) {
                                        $handler .= '//';
                                    }

                                    $handler .= $target;
                                }

                                $value[] = $handler;
                            }

                            break;
                        default:
                            $value = $found;
                            break;
                    }
                }
            }

            $this->config = $config;

            return true;
        }

        return false;
    }
protected function parseConfig ( $ config , $ defaults ) { if ( array_key_exists ( 'config' , $ config ) ) { $ configFileData = Resque :: readConfigFile ( $ config [ 'config' ] ) ; foreach ( $ config as $ key => & $ value ) { // If the config value is equal to the default value set in the command then // have a look at the config file. This is so that the config options can be // over-ridden in the command line. if ( isset ( $ this -> configOptionMap [ $ key ] ) and ( ( $ key === 'verbose' or $ value === $ defaults [ $ key ] ) and ( false !== Util :: path ( $ configFileData , $ this -> configOptionMap [ $ key ] , $ found ) ) ) ) { switch ( $ key ) { // Need to make sure the log handlers are in the correct format case 'log' : $ value = array ( ) ; foreach ( ( array ) $ found as $ handler => $ target ) { $ handler = strtolower ( $ handler ) ; if ( $ target !== true ) { $ handler .= ':' ; if ( in_array ( $ handler , array ( 'redis:' , 'mongodb:' , 'couchdb:' , 'amqp:' ) ) ) { $ handler .= '//' ; } $ handler .= $ target ; } $ value [ ] = $ handler ; } break ; default : $ value = $ found ; break ; } } } $ this -> config = $ config ; return true ; } return false ; }
Parses the configuration file

@param  mixed $config
@param  mixed $defaults
@return bool
Parses the configuration file