@param Config $config

@return $this
425120
protected function applyHooks(Config $config)
    {
        $hooks = $config->get('hooks', null);

        $config->set('hooks', []);

        if (!isset($hooks) || !is_array($hooks) || !count($hooks)) {
            return $this;
        }

        foreach ($hooks as $type => $hookDefinitions) {
            if (!is_array($hookDefinitions)) {
                $hookDefinitions = [];
            }
            if (count($hookDefinitions)) {
                $hooks[$type] = [];
            }
            foreach ($hookDefinitions as $hook) {
                if (!($hook instanceof HookInterface)) {
                    if (is_string($hook) && '@' === $hook{0}) {
                        $hook = new CommandHook($hook);
                    } else {
                        throw new \RuntimeException(sprintf("Unsupported hook definition format: %s", json_encode($hook)), 412);
                    }
                }
                $hooks[$type][] = $hook;
            }
        }

        $config->set('hooks', $hooks);

        return $this;
    }
1110482
public function load(array $config)
    {
        $config = $this->getParsedConfig(
            $config,
            $this->config,
            $this->yamlConfigMap,
            $this->required
        );
        $this->setParsedConfig($config);

        return $this;
    }
92391
public function applyConfig(array $config = []) {
        $parent = $this;
        $defaults = isset($this->_config) ? $this->_config : [];

        // Inherit config from parents
        while ($parent = get_parent_class($parent)) {
            $props = get_class_vars($parent);

            if (isset($props['_config'])) {
                $defaults = Hash::merge($props['_config'], $defaults);
            }
        }

        $this->__config = new ConfigAugment($config, $defaults);

        return $this;
    }
286353
public function setConfiguration($config) {
		if(!($config instanceof Config))
			$config = new Config($config);
		$this->config = $config;
	}
1041946
public function config($config)
    {
        if (is_array($config)) {
            $this->config = array_merge($this->config, $config);
        } elseif (isset($this->config[$config])) {
            return $this->config[$config];
        } else {
            return;
        }
    }
1180149
public function setConfig($config)
    {
        $this->config = $config instanceof Structure ? $config : new Structure($config);

        return $this;
    }
1329193
public function setConfig($config = [])
    {
        if (!empty($config) && is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = NULL;
        }
        $this->debug->debug(__FUNCTION__, '$this->config: ' . json_encode($this->config));

        return $this;
    }
60792
protected function setConfig(array $config = array())
    {
        $this->config = $config;

        if (isset($config['prefix'])) {
            $this->prefix = $config['prefix'];
        }

        if (isset($config['host'])) {
            $this->host = $config['host'];
        }

        if (isset($config['port'])) {
            $this->port = $config['port'];
        }

        return $this;
    }
1261156
protected function applyCommands(Config $config)
    {
        $commands = $config->get('commands', null);

        $config->set('commands', []);

        if (!isset($commands) || !is_array($commands) || !count($commands)) {
            return $this;
        }

        foreach ($commands as $commandName => $command) {
            if (!($command instanceof CommandInterface)) {
                $command = $this->instantiateCommand($command);
            }
            $config->setItem('commands', $commandName, $command);
        }

        return $this;
    }
575177
public function setup($config = [])
    {
        $path = toPath($config['path']);

        if (is_array($config)) {
            $this->setCache($config['name']);
            $this->setPath(CYGNITE_BASE.DS.$path.DS);
            $this->setCacheExtension($config['extension']);

            return $this;
        }

        $this->setCache($config);

        return $this;
    }
233617
public function setConfigs($config)
    {
        if (is_array($config) === false && $config instanceof \Traversable === false) {
            throw new \InvalidArgumentException(
                'Expected an array or Traversable; received: ' .
                (is_object($config) === true ? get_class($config) : gettype($config))
            );
        }
        foreach ($config as $name => $value) {
            $this->setConfig($name, $value);
        }
        return $this;
    }
720098
public function setConfig($config)
    {
        if (is_array($config)) {
            $this->config = new Config($config);
        } else {
            // see if it's a file path
            if (is_file($config)) {
                $cfg = parse_ini_file($config, true);
                $this->config = new Config($cfg);
            } else {
                throw new \InvalidArgumentException(
                    'Could not load configuration file '.$config
                );
            }
        }
    }
628638
public function set_config(array $config)
    {
        if (isset($config['convert_integers'])) {
            $this->config['convert_integers'] = (bool)$config['convert_integers'];
        }

        if (isset($config['typecast_objects'])) {
            $this->config['typecast_objects'] = (bool)$config['typecast_objects'];
        }

        return $this;
    }
1221366
public function setConfig(array $config)
    {
        if (empty($config)) {
            return $this;
        }

        foreach ($this->configurable as $setting) {
            if ( ! isset($config[$setting])) {
                continue;
            }

            if (property_exists($this, $setting)) {
                $this->$setting = $config[$setting];
            }
        }

        return $this;
    }
697653
public function init(array $config) {
		if ($config) {
			foreach ($config as $key => $value) {
				$method = 'set' . ucfirst(camel_case($key));

				if (method_exists($this, $method)) {
					$this->$method($value);
				}
			}
		}

		return $this;
	}
211340
public function setConfig(Config $config)
    {
        parent::setConfig($config);

        foreach ($this->sequence as $command) {
            $command->setConfig($config);
        }

        return $this;
    }
1263868
public function setConfig($config)
    {
        $this->config = $config;

        $this->routes = $config['routes'];
        $this->templates = $config['templates'];
        $this->options = $config['options'];
        $this->layoutView = $config['layout'];

        return $this;
    }