Esempio n. 1
0
        /**
         * Adds a dependency.
         */
        public void addDepend(Path path)
        {
            Depend depend = new Depend(path);

            depend.setRequireSource(_quercus.isRequireSource());

            _dependList.add(depend);
            _depend.add(depend);
        }
Esempio n. 2
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());
            }
        }
Esempio n. 4
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;
        }