Esempio n. 1
0
 static Apachai()
 {
     c = new ConfigManager ("config.json");
     store = new BackingStore (c);
     oauthConfig = new OAuthConfig (c.GetOrThrow<string> ("twitterKey"),
                                    c.GetOrThrow<string> ("twitterSecret"),
                                    c.GetOrThrow<string> ("twitterCallback"));
     oauth = new OAuth (oauthConfig);
     testInstance = c.GetOrDefault<bool> ("testInstance", false);
     baseServerUrl = c.GetOrThrow<string> ("serverBaseUrl");
     imgDirectory = c.GetOrDefault<string> ("imagesDirectory", "Pictures");
     UrlShortener.Store = store;
 }
Esempio n. 2
0
 public BackingStore(ConfigManager cfg)
 {
     try {
         var raw = cfg.GetOrDefault<IList<object>> ("redisServers", new [] { "127.0.0.1" });
         redisManager = new BasicRedisClientManager (raw.Cast<string> ().ToArray ());
     } catch (Exception e) {
         throw new BackingStoreException (e);
     }
 }