docs: function loadConfig(app, apimanager, models, currdir, snapdir, uid, cb) {
    logger.debug('loadConfig entry');
    var dirToLoad = (snapdir === '') ? currdir : snapdir;
  
    loadConfigFromFS(app, apimanager, models, dirToLoad, uid, function(err) {
      if (err) {
        logger.error(err);
        logger.debug('loadConfig error(1)');
        cb(err);
        return;
      } else if (mixedProtocols) {
        logger.debug('loadConfig error(2)');
        cb(new Error('mixed protocols'));
        return;
      } else {
        // update current snapshot pointer
        updateSnapshot(app, uid, function(err) {
          if (err) {
            logger.debug('loadConfig error(3)');
            cb(err);
            return;
          }
  
          // only update pointer to latest configuration
          // when latest configuration successful loaded
          if (snapdir === dirToLoad) {
            process.env[CONFIGDIR] = snapdir;
            setPreviousSnapshotDir(snapdir);
          }
  
          logger.debug('loadConfig exit');
          cb();
        });
      }
    });
  }