public void run()
        {
            var container = new BasicDependencyContainer(
                new BasicDependencyFactories(registration_services, WebFactories.special_case_dependency_factory));

            registration_services.register<DependencyContainer>(container);
            registration_services.register<ConstructorSelectionStrategy>(
                new GreedyConstructorSelectionStrategy());

            Container.container_factory = () => container;
        }
        public void run()
        {
            var registry = new DefaultDependencyFactories(startup_facilities.original_factories);
            DependencyContainer the_container = new BasicDependencyContainer(registry);
            ContainerResolver resolver = () => the_container;
            Container.container_resolver = resolver;

            startup_facilities.register(the_container);
            startup_facilities.register<LoggerFactory, Log4NetLoggerFactory>();
            startup_facilities.register<Log4NetInitializationCommand, DefaultLog4NetInitializationCommand>();
        }
Пример #3
0
        /**
         * Creates a new quercus program
         *
         * @param quercus the owning quercus engine
         * @param sourceFile the path to the source file
         * @param statement the top-level statement
         */
        public QuercusProgram(QuercusContext quercus,
                              string sourceFile,
                              QuercusPage page)
        {
            _quercus      = quercus;
            _sourceFile   = sourceFile;
            _compiledPage = page;

            _depend = new BasicDependencyContainer();

            _topDepend = new BasicDependencyContainer();
            _topDepend.setCheckInterval(quercus.getDependencyCheckInterval());
            _topDepend.add(new PageDependency());
        }
        private void init()
        {
            if (_pathPO != null && _pathPO.exists())
            {
                _currentPath = _pathPO;
            }
            else if (_pathMO != null && _pathMO.exists())
            {
                _currentPath = _pathMO;
            }
            else
            {
                return;
            }

            try {
                GettextParser parser;

                if (_depend == null)
                {
                    _depend = new BasicDependencyContainer();
                }

                _depend.add(new Depend(_currentPath));

                if (_currentPath == _pathPO)
                {
                    parser = new POFileParser(_env, _currentPath);
                }
                else
                {
                    parser = new MOFileParser(_env, _currentPath);
                }

                _pluralExpr   = parser.getPluralExpr();
                _translations = parser.readTranslations();
                _charset      = parser.getCharset();

                parser.close();
            } catch (IOException e) {
                throw new QuercusModuleException(e.getMessage());
            }
        }
Пример #5
0
        /**
         * Creates a new quercus program
         *
         * @param quercus the owning quercus engine
         * @param sourceFile the path to the source file
         * @param statement the top-level statement
         */
        public QuercusProgram(QuercusContext quercus,
                              string sourceFile,
                              HashMap <StringValue, Function> functionMap,
                              ArrayList <Function> functionList,
                              HashMap <String, InterpretedClassDef> classMap,
                              ArrayList <InterpretedClassDef> classList,
                              FunctionInfo functionInfo,
                              Statement statement)
        {
            _quercus = quercus;

            _depend = new BasicDependencyContainer();
            _depend.setCheckInterval(quercus.getDependencyCheckInterval());

            _topDepend = new BasicDependencyContainer();
            _topDepend.setCheckInterval(quercus.getDependencyCheckInterval());
            _topDepend.add(new PageDependency());

            _sourceFile = sourceFile;
            if (sourceFile != null)
            {
                addDepend(sourceFile);
            }

            _functionMap  = functionMap;
            _functionList = functionList;

            for (Map.Entry <StringValue, Function> entry : functionMap.entrySet())
            {
                _functionMapLowerCase.put(entry.getKey().toLowerCase(Locale.ENGLISH),
                                          entry.getValue());
            }

            _classMap  = classMap;
            _classList = classList;

            _functionInfo = functionInfo;
            _statement    = statement;
        }