get($resourceName)) === null) { throw new ConfigurationError('Resource "' . $resourceName . '" couldn\'t be retrieved'); } return $resourceConfig; } public static function createResource(Zend_Config $config) { switch (strtolower($config->type)) { case 'db': $resource = new DbConnection($config); break; case 'statusdat': $resource = new StatusdatReader($config); break; default: throw new ConfigurationError('Unsupported resource type "' . $config->type . '"'); } return $resource; } }