@@ 190-208 (lines=19) @@ | ||
187 | return $this; |
|
188 | } |
|
189 | ||
190 | private function getCollectorClassName($type) |
|
191 | { |
|
192 | if(false == strpos($type, '_')) { |
|
193 | $className = ucfirst($type); |
|
194 | } else { |
|
195 | $className = implode('', array_map('ucfirst', explode('_', $type))); |
|
196 | } |
|
197 | ||
198 | $className .= 'Collector'; |
|
199 | ||
200 | foreach($this->collectorNamespaces as $namespace) { |
|
201 | $fullyQualifiedClassName = $namespace . '\\' . $className; |
|
202 | if(class_exists($fullyQualifiedClassName)) { |
|
203 | return $fullyQualifiedClassName; |
|
204 | } |
|
205 | } |
|
206 | ||
207 | throw new \Exception('Class ' . $fullyQualifiedClassName . ' not found'); |
|
208 | } |
|
209 | ||
210 | /* |
|
211 | * @param int $requestNumber maximum number of allowed requests |
|
@@ 242-260 (lines=19) @@ | ||
239 | ||
240 | } |
|
241 | ||
242 | private function getStorageClassName($type) |
|
243 | { |
|
244 | if(false == strpos($type, '_')) { |
|
245 | $className = ucfirst($type); |
|
246 | } else { |
|
247 | $className = implode('', array_map('ucfirst', explode('_', $type))); |
|
248 | } |
|
249 | ||
250 | $className .= 'Storage'; |
|
251 | ||
252 | foreach($this->storageNamespaces as $namespace) { |
|
253 | $fullyQualifiedClassName = $namespace . '\\' . $className; |
|
254 | if(class_exists($fullyQualifiedClassName)) { |
|
255 | return $fullyQualifiedClassName; |
|
256 | } |
|
257 | } |
|
258 | ||
259 | throw new \Exception('Class ' . $fullyQualifiedClassName . ' not found'); |
|
260 | } |
|
261 | ||
262 | public function createStorage($type, $configuratorCallable = null) |
|
263 | { |