/** * Gets the config for given command key * * @param string $commandKey * @return Config */ protected function getCommandConfig($commandKey) { if (isset($this->configsPerCommandKey[$commandKey])) { return $this->configsPerCommandKey[$commandKey]; } $config = new Config($this->config->get('default')->toArray(), true); if ($this->config->__isset($commandKey)) { $commandConfig = $this->config->get($commandKey); $config->merge($commandConfig); } $this->configsPerCommandKey[$commandKey] = $config; return $config; }
/** * Sets base command configuration from the global phystrix configuration * * @param Config $phystrixConfig */ public function initializeConfig(Config $phystrixConfig) { $commandKey = $this->getCommandKey(); $config = new Config($phystrixConfig->get('default')->toArray(), true); if ($phystrixConfig->__isset($commandKey)) { $commandConfig = $phystrixConfig->get($commandKey); $config->merge($commandConfig); } $this->config = $config; }