| @@ 140-156 (lines=17) @@ | ||
| 137 | ||
| 138 | } |
|
| 139 | ||
| 140 | public static function createFromConfiguration(Configuration $configuration, LoggerInterface $logger) { |
|
| 141 | ||
| 142 | list($manager_configuration, $providers) = ConfigurationParser::parse($configuration, $logger); |
|
| 143 | ||
| 144 | $manager = new Manager(...$manager_configuration); |
|
| 145 | ||
| 146 | foreach ($providers as $name => $provider) { |
|
| 147 | $instance = $provider->instance; |
|
| 148 | $weight = $provider->weight; |
|
| 149 | $id = $instance->getId(); |
|
| 150 | $logger->debug("Adding provider $name ($id) to cache manager (w $weight)"); |
|
| 151 | $manager->addProvider($instance, $weight); |
|
| 152 | } |
|
| 153 | ||
| 154 | return $manager; |
|
| 155 | ||
| 156 | } |
|
| 157 | ||
| 158 | protected function selectFrom($mode, $key) { |
|
| 159 | ||
| @@ 178-194 (lines=17) @@ | ||
| 175 | ||
| 176 | } |
|
| 177 | ||
| 178 | public static function createFromConfiguration(Configuration $configuration, LoggerInterface $logger) { |
|
| 179 | ||
| 180 | list($manager_configuration, $providers) = ConfigurationParser::parse($configuration, $logger); |
|
| 181 | ||
| 182 | $manager = new Manager(...$manager_configuration); |
|
| 183 | ||
| 184 | foreach ($providers as $name => $provider) { |
|
| 185 | $instance = $provider->instance; |
|
| 186 | $weight = $provider->weight; |
|
| 187 | $id = $instance->getId(); |
|
| 188 | $logger->debug("Adding provider $name ($id) to cache manager (w $weight)"); |
|
| 189 | $manager->addProvider($instance, $weight); |
|
| 190 | } |
|
| 191 | ||
| 192 | return $manager; |
|
| 193 | ||
| 194 | } |
|
| 195 | ||
| 196 | protected function selectFrom($mode, $key, $default=null) { |
|
| 197 | ||