public ReducedContentHandler(IRRConfiguration config, IHostingEnvironmentWrapper hostingEnvironment, IUriBuilder uriBuilder, IStore store)
 {
     this.config = config;
     this.hostingEnvironment = hostingEnvironment;
     this.uriBuilder = uriBuilder;
     this.store = store;
 }
Example #2
0
 public DbDiskCache(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder) : base(fileWrapper, configuration, uriBuilder, null)
 {
     RRTracer.Trace("Creating db disk cache");
     const int interval = 1000*60*5;
     timer = new Timer(PurgeOldFiles, null, 0, interval);
     _cacheLock = new ReaderWriterLockSlim();
 }
        public DbDiskCache(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder) : base(fileWrapper, configuration, uriBuilder, null)
        {
            RRTracer.Trace("Creating db disk cache");
            const int interval = 1000 * 60 * 5;

            timer = new Timer(PurgeOldFiles, null, 0, interval);
        }
 public ReducedContentHandler(IRRConfiguration config, IHostingEnvironmentWrapper hostingEnvironment, IUriBuilder uriBuilder, IStore store)
 {
     this.config             = config;
     this.hostingEnvironment = hostingEnvironment;
     this.uriBuilder         = uriBuilder;
     this.store = store;
 }
Example #5
0
        public ReducerFacts()
        {
            config = RRContainer.Current.GetInstance <IRRConfiguration>();
            var rrFolder = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "\\RequestReduce.SampleWeb\\FactContent";

            config.ResourcePhysicalPath = rrFolder;
        }
Example #6
0
 public ResponseTransformer(IReductionRepository reductionRepository, IReducingQueue reducingQueue, HttpContextBase context, IRRConfiguration config)
 {
     this.reductionRepository = reductionRepository;
     this.reducingQueue       = reducingQueue;
     this.context             = context;
     this.config = config;
 }
Example #7
0
 public CssReducer(IWebClientWrapper webClientWrapper, IStore store, IMinifier minifier, ISpriteManager spriteManager, ICssImageTransformer cssImageTransformer, IUriBuilder uriBuilder, IRRConfiguration configuration)
     : base(webClientWrapper, store, minifier, uriBuilder)
 {
     this.cssImageTransformer = cssImageTransformer;
     this.configuration       = configuration;
     this.spriteManager       = spriteManager;
 }
Example #8
0
        public SqlServerStoreFacts()
        {
            var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                          "\\RequestReduce.SampleWeb\\App_Data";

            if (Directory.Exists(dataDir))
            {
                File.Delete(dataDir + "\\RequestReduce.sdf");
            }
            else
            {
                Directory.CreateDirectory(dataDir);
            }

            RequestReduceDB.DefaultProviderName = "System.Data.SQLite";
            var mockConfig = new Mock <IRRConfiguration>();

            mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf;Version=3;");
            config = mockConfig.Object;
            repo   = new FileRepository(config);
            IntegrationFactHelper.RecyclePool();
            repo.GetDatabase().Execute(SqliteHelper.GetSqlLightSafeSql());
            rrFolder   = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore, 3000);
            uriBuilder = new UriBuilder(config);
        }
Example #9
0
 public SpriteManager(IWebClientWrapper webClientWrapper, IRRConfiguration config, IUriBuilder uriBuilder, IStore store)
 {
     this.webClientWrapper = webClientWrapper;
     this.uriBuilder = uriBuilder;
     this.store = store;
     this.config = config;
     SpriteContainer = new SpriteContainer(webClientWrapper);
 }
Example #10
0
 public DashboardHandler(IRRConfiguration config, IIpFilter ipFilter, IReducingQueue queue, IReductionRepository repo, IUriBuilder uriBuilder)
 {
     this.config     = config;
     this.ipFilter   = ipFilter;
     this.queue      = queue;
     this.repo       = repo;
     this.uriBuilder = uriBuilder;
 }
Example #11
0
 public DashboardHandler(IRRConfiguration config, IIpFilter ipFilter, IReducingQueue queue, IReductionRepository repo, IUriBuilder uriBuilder)
 {
     this.config = config;
     this.ipFilter = ipFilter;
     this.queue = queue;
     this.repo = repo;
     this.uriBuilder = uriBuilder;
 }
Example #12
0
 public LocalDiskStore(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder)
 {
     this.fileWrapper = fileWrapper;
     this.configuration = configuration;
     configuration.PhysicalPathChange += SetupWatcher;
     this.uriBuilder = uriBuilder;
     SetupWatcher();
 }
Example #13
0
 public PngOptimizer(IFileWrapper fileWrapper, IRRConfiguration configuration, IWuQuantizer wuQuantizer)
 {
     this.fileWrapper = fileWrapper;
     this.configuration = configuration;
     this.wuQuantizer = wuQuantizer;
     var dllDir = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
     optiPngLocation = string.Format("{0}\\OptiPng.exe", dllDir);
 }
Example #14
0
            public FakeFileRepository(IRRConfiguration config)
                : base(config)
            {
                RequestReduceDB.DefaultProviderName = "System.Data.SQLite";
                var db = GetDatabase();

                db.KeepConnectionAlive = true;
                db.Execute(SqliteHelper.GetSqlLightSafeSql());
            }
Example #15
0
 public FlushHandler(IRRConfiguration configuration, IHostingEnvironmentWrapper hostingEnvironment, IIpFilter ipFilter, IReducingQueue queue, IUriBuilder uriBuilder, IStore store)
 {
     this.configuration = configuration;
     this.hostingEnvironment = hostingEnvironment;
     this.ipFilter = ipFilter;
     this.queue = queue;
     this.uriBuilder = uriBuilder;
     this.store = store;
 }
Example #16
0
 public FlushHandler(IRRConfiguration configuration, IHostingEnvironmentWrapper hostingEnvironment, IIpFilter ipFilter, IReducingQueue queue, IUriBuilder uriBuilder, IStore store)
 {
     this.configuration      = configuration;
     this.hostingEnvironment = hostingEnvironment;
     this.ipFilter           = ipFilter;
     this.queue      = queue;
     this.uriBuilder = uriBuilder;
     this.store      = store;
 }
Example #17
0
        public PngOptimizer(IFileWrapper fileWrapper, IRRConfiguration configuration, IWuQuantizer wuQuantizer)
        {
            this.fileWrapper   = fileWrapper;
            this.configuration = configuration;
            this.wuQuantizer   = wuQuantizer;
            var dllDir = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;

            optiPngLocation = string.Format("{0}\\OptiPng.exe", dllDir);
        }
Example #18
0
 public SpriteManager(IWebClientWrapper webClientWrapper, IRRConfiguration config, IUriBuilder uriBuilder, IStore store, IPngOptimizer pngOptimizer)
 {
     this.webClientWrapper = webClientWrapper;
     this.uriBuilder       = uriBuilder;
     this.store            = store;
     this.pngOptimizer     = pngOptimizer;
     this.config           = config;
     SpriteContainer       = new SpriteContainer(webClientWrapper, config);
 }
Example #19
0
 public ResponseTransformer(IReductionRepository reductionRepository, IReducingQueue reducingQueue, HttpContextBase context, IRRConfiguration config, IUriBuilder uriBuilder, IRelativeToAbsoluteUtility relativeToAbsoluteUtility)
 {
     this.reductionRepository = reductionRepository;
     this.reducingQueue       = reducingQueue;
     this.context             = context;
     this.config     = config;
     this.uriBuilder = uriBuilder;
     this.relativeToAbsoluteUtility = relativeToAbsoluteUtility;
 }
Example #20
0
 public LocalDiskStore(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder, IReductionRepository reductionRepository)
 {
     this.fileWrapper = fileWrapper;
     this.configuration = configuration;
     configuration.PhysicalPathChange += SetupWatcher;
     this.uriBuilder = uriBuilder;
     this.reductionRepository = reductionRepository;
     if(configuration.IsFullTrust)
         SetupWatcher();
 }
Example #21
0
 public SpriteManagerToTest(IWebClientWrapper webClientWrapper, IRRConfiguration config, IUriBuilder uriBuilder, IStore store, IPngOptimizer pngOptimizer) : base(webClientWrapper, config, uriBuilder, store, pngOptimizer)
 {
     MockSpriteContainer = new Mock <ISpriteContainer>();
     MockSpriteContainer.Setup(x => x.GetEnumerator()).Returns(new List <SpritedImage>().GetEnumerator());
     MockSpriteContainer.Setup(x => x.Width).Returns(1);
     MockSpriteContainer.Setup(x => x.Height).Returns(1);
     MockSpriteContainer.Setup(x => x.AddImage(It.IsAny <BackgroundImageClass>())).
     Returns((BackgroundImageClass c) => new SpritedImage(1, c, null));
     base.SpriteContainer = MockSpriteContainer.Object;
     SpritedCssKey        = Guid.NewGuid();
 }
Example #22
0
 public FileRepository(IRRConfiguration config) : base(config)
 {
     if (RequestReduceContext.SqlCeType == null || RequestReduceContext.SqlCeType != Context.Database.Connection.GetType())
     {
         Database.SetInitializer <RequestReduceContext>(null);
     }
     else
     {
         Database.SetInitializer(new DropCreateDatabaseIfModelChanges <RequestReduceContext>());
     }
     Context.Database.Initialize(false);
 }
Example #23
0
 public LocalDiskStore(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder, IReductionRepository reductionRepository)
 {
     FileWrapper        = fileWrapper;
     this.configuration = configuration;
     configuration.PhysicalPathChange += SetupWatcher;
     this.uriBuilder     = uriBuilder;
     ReductionRepository = reductionRepository;
     if (configuration.IsFullTrust)
     {
         SetupWatcher();
     }
 }
 public SqlServerStoreFacts()
 {
     var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                   "\\RequestReduce.SampleWeb\\App_Data";
     if (!Directory.Exists(dataDir))
         Directory.CreateDirectory(dataDir);
     Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
     var mockConfig = new Mock<IRRConfiguration>();
     mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf");
     config = mockConfig.Object;
     repo = new FileRepository(config);
     repo.Context.Database.Delete();
     rrFolder = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore);
     uriBuilder = new UriBuilder(config);
 }
        public SqlServerStoreFacts()
        {
            var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                          "\\RequestReduce.SampleWeb\\App_Data";
            if (Directory.Exists(dataDir))
                File.Delete(dataDir + "\\RequestReduce.sdf");
            else
                Directory.CreateDirectory(dataDir);

            RequestReduceDB.DefaultProviderName = "System.Data.SQLite";
            var mockConfig = new Mock<IRRConfiguration>();
            mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf;Version=3;");
            config = mockConfig.Object;
            repo = new FileRepository(config);
            IntegrationFactHelper.RecyclePool();
            repo.GetDatabase().Execute(SqliteHelper.GetSqlLightSafeSql());
            rrFolder = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore, 3000);
            uriBuilder = new UriBuilder(config);
        }
        public SqlServerStoreFacts()
        {
            var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                          "\\RequestReduce.SampleWeb\\App_Data";

            if (!Directory.Exists(dataDir))
            {
                Directory.CreateDirectory(dataDir);
            }
            Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
            var mockConfig = new Mock <IRRConfiguration>();

            mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf");
            config = mockConfig.Object;
            repo   = new FileRepository(config);
            IntegrationFactHelper.RecyclePool();
            repo.Context.Database.Delete();
            repo.Context.Database.Create();
            rrFolder   = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore, 3000);
            uriBuilder = new UriBuilder(config);
        }
 public FakeDbDiskCache(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder)
     : base(fileWrapper, configuration, uriBuilder)
 {
     timer.Dispose();
 }
 public RelativeToAbsoluteUtility(HttpContextBase context, IRRConfiguration config)
 {
     this.context = context;
     this.config  = config;
 }
Example #29
0
 public SpriteContainer(IWebClientWrapper webClientWrapper, IRRConfiguration rrConfiguration)
 {
     this.webClientWrapper = webClientWrapper;
     this.rrConfiguration  = rrConfiguration;
 }
Example #30
0
 public Repository(IRRConfiguration config)
 {
     db = IsConnectionStringName(config.ConnectionStringName)
              ? new RequestReduceDB(config.ConnectionStringName)
              : new RequestReduceDB(config.ConnectionStringName, RequestReduceDB.DefaultProviderName);
 }
Example #31
0
 public IpFilter(IRRConfiguration config)
 {
     this.config = config;
 }
Example #32
0
 public ReductionRepository(IRRConfiguration configuration)
 {
     this.configuration = configuration;
     RRTracer.Trace("creating reduction repository");
     refresher = new Timer(LoadDictionaryWithExistingItems, null, 100, configuration.StorePollInterval);
 }
Example #33
0
 public FakeReductionRepository(IRRConfiguration configuration) : base(configuration)
 {
 }
Example #34
0
 public FileRepository(IRRConfiguration config)
     : base(config)
 {
 }
Example #35
0
 public DbDiskCache(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder)
     : base(fileWrapper, configuration, uriBuilder)
 {
     const int interval = 1000*60*5;
     timer = new Timer(PurgeOldFiles, null, 0, interval);
 }
 public FileRepository(IRRConfiguration config)
     : base(config)
 {
 }
Example #37
0
 public FakeSpriteContainer(IWebClientWrapper webClientWrapper, IRRConfiguration config) : base(webClientWrapper, config)
 {
 }
Example #38
0
 public HandlerFactory(IRRConfiguration config, IUriBuilder uriBuilder)
 {
     this.config     = config;
     this.uriBuilder = uriBuilder;
     AddHandlerMap(DefaultMap);
 }
 public RelativeToAbsoluteUtility(HttpContextBase context, IRRConfiguration config)
 {
     this.context = context;
     this.config = config;
 }
 public JavaScriptReducer(IWebClientWrapper webClientWrapper, IStore store, IMinifier minifier, IUriBuilder uriBuilder, IRRConfiguration config, IResponseDecoder responseDecoder) : base(webClientWrapper, store, minifier, uriBuilder)
 {
     this.config          = config;
     this.responseDecoder = responseDecoder;
 }
Example #41
0
 public FakeFileRepository(IRRConfiguration config)
     : base(config)
 {
     Database.SetInitializer(new DropCreateDatabaseAlways <RequestReduceContext>());
     Context.Database.Initialize(true);
 }
Example #42
0
 public SpriteContainer(IWebClientWrapper webClientWrapper, IRRConfiguration rrConfiguration)
 {
     this.webClientWrapper = webClientWrapper;
     this.rrConfiguration = rrConfiguration;
 }
Example #43
0
 public UriBuilder(IRRConfiguration configuration)
 {
     this.configuration = configuration;
 }
 public ReductionRepository(IRRConfiguration configuration)
 {
     this.configuration = configuration;
     RRTracer.Trace("creating reduction repository");
     refresher = new Timer(LoadDictionaryWithExistingItems, null, 100, configuration.StorePollInterval);
 }
Example #45
0
 public HandlerFactory(IRRConfiguration config, IUriBuilder uriBuilder)
 {
     this.config = config;
     this.uriBuilder = uriBuilder;
     AddHandlerMap(DefaultMap);
 }
 public FakeLocalDiskStore(IFileWrapper fileWrapper, IRRConfiguration configuration, IUriBuilder uriBuilder, IReductionRepository reductionRepository)
     : base(fileWrapper, configuration, uriBuilder, reductionRepository)
 {
 }
Example #47
0
 public Repository(IRRConfiguration config)
 {
     this.config = config;
 }
Example #48
0
 public IpFilter(IRRConfiguration config)
 {
     this.config = config;
 }
Example #49
0
 public ReducerFacts()
 {
     config = RRContainer.Current.GetInstance<IRRConfiguration>();
     var rrFolder = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName + "\\RequestReduce.SampleWeb\\FactContent";
     config.SpritePhysicalPath = rrFolder;
 }