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