$app['doctrine.cache.factory.memcache'] = $app->protect(function ($cacheOptions) {
            if (empty($cacheOptions['host']) || empty($cacheOptions['port'])) {
                throw new \RuntimeException('Host and port options need to be specified for memcache cache');
            }