| @@ 144-160 (lines=17) @@ | ||
| 141 | ||
| 142 | } |
|
| 143 | ||
| 144 | public static function createFromConfiguration(Configuration $configuration, LoggerInterface $logger) { |
|
| 145 | ||
| 146 | list($manager_configuration, $providers) = ConfigurationParser::parse($configuration, $logger); |
|
| 147 | ||
| 148 | $manager = new Manager(...$manager_configuration); |
|
| 149 | ||
| 150 | foreach ($providers as $name => $provider) { |
|
| 151 | $instance = $provider->instance; |
|
| 152 | $weight = $provider->weight; |
|
| 153 | $id = $instance->getId(); |
|
| 154 | $logger->debug("Adding provider $name ($id) to cache manager (w $weight)"); |
|
| 155 | $manager->addProvider($instance, $weight); |
|
| 156 | } |
|
| 157 | ||
| 158 | return $manager; |
|
| 159 | ||
| 160 | } |
|
| 161 | ||
| 162 | protected function selectFrom($mode, $key) { |
|
| 163 | ||
| @@ 186-202 (lines=17) @@ | ||
| 183 | ||
| 184 | } |
|
| 185 | ||
| 186 | public static function createFromConfiguration(Configuration $configuration, LoggerInterface $logger) { |
|
| 187 | ||
| 188 | list($manager_configuration, $providers) = ConfigurationParser::parse($configuration, $logger); |
|
| 189 | ||
| 190 | $manager = new Manager(...$manager_configuration); |
|
| 191 | ||
| 192 | foreach ($providers as $name => $provider) { |
|
| 193 | $instance = $provider->instance; |
|
| 194 | $weight = $provider->weight; |
|
| 195 | $id = $instance->getId(); |
|
| 196 | $logger->debug("Adding provider $name ($id) to cache manager (w $weight)"); |
|
| 197 | $manager->addProvider($instance, $weight); |
|
| 198 | } |
|
| 199 | ||
| 200 | return $manager; |
|
| 201 | ||
| 202 | } |
|
| 203 | ||
| 204 | protected function selectFrom($mode, $key, $default=null) { |
|
| 205 | ||