• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/HTML/Template/H13-May-2013-3,3872,257

t/H13-May-2013-1,7051,323

templates/H13-May-2013-770482

templates-Pro/H13-May-2013-1,4711,069

.gitignoreH A D28-Aug-2010423 2221

ARTISTICH A D02-Dec-20076 KiB13299

ChangesH A D13-May-201310.9 KiB327258

FAQH A D28-Jul-20091.7 KiB6152

LGPLH A D21-Jul-200925.8 KiB505418

MANIFESTH A D13-May-20135.1 KiB227226

META.ymlH A D13-May-2013635 2625

Makefile.PLH A D29-Feb-201210 KiB384326

Pro.xsH A D13-May-201320.9 KiB680569

READMEH A D28-Feb-20123.8 KiB11079

README.ruH A D07-May-2007847

README.win32H A D22-Nov-20093.5 KiB8974

TODOH A D23-Nov-20091.9 KiB6047

benchmark.pl.tH A D02-Dec-20073.7 KiB11398

builtin_findfile.incH A D28-Aug-201013.1 KiB376340

calc.hH A D25-Jun-2010672 3016

calc.incH A D26-Mar-20103.3 KiB122105

callback_stubs.incH A D29-Aug-20102.1 KiB6452

cmp_expr.tH A D02-Dec-2007809 3327

expr.cH A D28-Sep-201071.3 KiB2,3971,689

expr.yH A D17-Jun-201016.9 KiB506410

expr_iface.cH A D03-Sep-20091.8 KiB9577

exprpstr.hH A D17-Jun-2010763 3724

exprpstr.incH A D28-Sep-20104.5 KiB169157

exprtool.hH A D17-Jun-20103.8 KiB10571

exprtool.incH A D13-Oct-20098.4 KiB290269

exprtype.hH A D02-Sep-20091.3 KiB6337

exprval.hH A D04-Sep-2009471 3114

loadfile.hH A D07-May-2007225 122

loadfile.incH A D25-Aug-20104.8 KiB172144

loopvar.incH A D14-Sep-20093.3 KiB114106

optint.cH A D15-Nov-200931.1 KiB1,7791,755

optint.hH A D15-Nov-2009159 92

pabidecl.hH A D09-Aug-20091.4 KiB5535

pabstract.hH A D21-Sep-200918.2 KiB42235

parse_expr.hH A D05-Aug-2009301 166

pbuffer.cH A D14-Sep-20091.8 KiB7766

pbuffer.hH A D14-Sep-2009798 3220

pconst.hH A D28-Aug-2010312 198

perl-HTML-Template-Pro.specH A D13-May-20137.7 KiB272182

pmiscdef.hH A D24-Sep-20091.6 KiB7339

pparam.hH A D13-May-20133.7 KiB12372

pparam2proparamH A D22-Nov-20097.8 KiB274210

ppport.hH A D20-Aug-200929.1 KiB1,099727

procore.cH A D28-Aug-201021.9 KiB737618

procore.hH A D29-Aug-2010528 2717

proparam.cH A D17-Feb-201010.9 KiB456379

proparam.hH A D17-Feb-201025.9 KiB59178

proscope.hH A D01-Sep-2009773 3318

proscope.incH A D14-Sep-20092.8 KiB11198

prostate.hH A D20-Sep-2009886 4727

prostate.incH A D24-Feb-2012775 2825

provalue.hH A D04-Aug-2009224 155

pstring.hH A D08-Sep-20091.5 KiB6111

pstrutils.hH A D27-Aug-2009473 2610

pstrutils.incH A D26-Dec-20115.5 KiB191180

tags.incH A D24-Feb-201216.8 KiB520488

tagstack.hH A D24-Feb-2012794 3323

tagstack.incH A D24-Feb-20121.6 KiB6959

test_crlf.outH A D07-May-200747 53

tmpllog.cH A D17-Feb-20101.2 KiB7151

tmpllog.hH A D17-Feb-2010941 3216

tmplpro.hH A D17-Feb-20109.2 KiB27448

tmplpro_version.cH A D28-Sep-2010899 4015

README

1HTML-Template-Pro version 0.9509
2==============================
3
4DESCRIPTION
5
6Original HTML::Template is written by Sam Tregar, sam@tregar.com
7with contributions of many people mentioned there.
8Their efforts caused HTML::Template to be mature html tempate engine
9which separate perl code and html design.
10Yet powerful, HTML::Template is slow, especially if mod_perl isn't
11available or in case of disk usage and memory limitations.
12
13HTML::Template::Pro is a fast lightweight C/Perl+XS reimplementation
14of HTML::Template (as of 2.9) and HTML::Template::Expr (as of 0.0.7).
15It is not intended to be a complete replacement,
16but to be a fast implementation of HTML::Template if you don't need
17quering, the extended facility of HTML::Template.
18Designed for heavy upload, resource limitations, abcence of mod_perl.
19
20HTML::Template::Pro has complete support of filters and HTML::Template::Expr's
21tag EXPR="<expression>", including user-defined functions.
22
23HTML::Template work cycle uses 2 steps. First, it loads and parse template.
24Then it accepts param() calls until you call output().
25output() is its second phase where it produces a page from the parsed tree
26of template, obtained in the 1st step.
27
28HTML::Template::Pro loads, parse and outputs template on fly,
29when you call $tmpl->output(), in one pass. The corresponding code is
30written in C and glued to Perl using Perl+XS. As a result,
31when compared to HTML::Template in ordinary calls, it runs
3210-25 times faster. Comparing to HTML::Template with all caching enabled
33under mod_perl, it still 1-3 times faster. At that HTML::Template caching
34requires considerable amount of memory (per process, shareable, or on disk)
35to be permanently filled with parsed trees, whereas HTML::Template::Pro
36doesn't consume memory for caches and use mmap() for reading templates on disk.
37
38INSTALLATION
39
40This module is tested on Linux and FreeBSD. There are success reports
41on MacOS X, Solaris, Windows. Windows users should look at README.win32.
42For Unixes it currently use POSIX mmap() system call,
43which may be unavaliable on some systems.
44In such case add argument MMAP=0 to perl Makefile.PL.
45
46To install this module type the following:
47
48   perl Makefile.PL
49   make
50   make test
51   make install
52
53If you have libpcre installed try
54   perl Makefile.PL PCRE=1
55
56other optional parameters include DEBUG (build with extra debug level)
57and IMITATE (imitate behavior of HTML::Template in all circumstances,
58even on broken templates, for a little cost of  perfomance).
59
60So a fully fledged build is
61   perl Makefile.PL PCRE=1 DEBUG=1 IMITATE=1
62
63DEPENDENCIES
64
65This module requires these other modules and libraries:
66
67modules:
68  File::Spec
69
70libraries:
71  libpcre (optional)
72
73TODO
74
75Add support for die_on_bad_params => 1.
76Add support for quering.
77Improve debug message subsystem.
78
79WEBSITE
80
81You can find information about HTML::Template::Pro at:
82
83   http://html-tmpl-pro.sourceforge.net
84	and
85   http://sourceforge.net/projects/html-tmpl-pro
86
87Original HTML::Template and other related modules are located at:
88
89   http://html-template.sourceforge.net
90
91
92COPYRIGHT AND LICENCE
93
94Copyright (C) 2005-2009 by I. Yu. Vlasenko.
95Pieces of code in Pro.pm and documentation of HTML::Template are
96copyright (C) 2000-2009 Sam Tregar (sam@tregar.com)
97Other contributors to the code base are listed in Changes.
98
99The template syntax, interface conventions and a large piece of documentation
100of HTML::Template::Pro are based on CPAN module HTML::Template
101by Sam Tregar, sam@tregar.com.
102
103This library is free software; you can redistribute it and/or modify
104it under the same terms as Perl itself, either Perl version 5.8.4 or,
105at your option, any later version of Perl 5 you may have available,
106or, at your option, under the terms of the GNU Lesser General Public License
107as published by the Free Software Foundation; either version 2 of the
108License, or (at your option) any later version.
109
110

README.win32

1Compiling and using either perl module HTML::Template::Pro or
2C library backend htmltmplpro.dll under win32/win64.
3----------------------------------------------------------
4Note that issues related to other languages' bindings
5are discussed in corresponding bindings.
6
7Release 0.82 and later have full native support for win32
8and win64. The source of HTML-Template-Pro should be ANSI C portable,
9except unix/win specific sections of file loadfile.inc.
10Those sections can be enabled with MMAP=1 or disabled with MMAP=0.
11If MMAP=0 (--without-mmap) slow ANSI C buffered read will be used instead.
12
13There is ifdef-ed section of win32/win64-specific code, with code fixes
14and improved section of WIN32 code of Viacheslav Sheveliov.
15Also, it is known to build successfully on WIN64, thanks to
16Robert Henniger.
17
18Windows memory mapping code use MapViewOfFile/UnmapViewOfFile WIN32 system calls.
19It was disabled by default, because it might not be compatible with
20original HTML-Template when dealing with CRLF-ed templates
21(It opens them in binary mode instead of text one).
22[UPD: I think there should be no difference, at least for C library.
23Windows users, please, test and enlighten me!]
24Nevertheless, compiling with MMAP=1 (--with-mmap, -DUSE_MMAP) should
25improve perfomance and/or memory consumption.
26
27Latest releases of htmltmplpro, built with mingw32 for win32 are
28avaliable on sourceforge and in sisyphus.ru: see
29http://www.sisyphus.ru/en/srpm/Sisyphus/mingw32-htmltmplpro
30http://www.sisyphus.ru/en/srpm/Sisyphus/mingw32-pcre
31
32If you want to compile htmltmplpro from sources and you do want to use
33regexps in EXPR="..." you need an optional PCRE library.
34
35Optional PCRE library for win32 can be obtained either from Sisyphus,
36http://www.sisyphus.ru/en/srpm/Sisyphus/mingw32-pcre
37or from http://gnuwin32.sourceforge.net/packages/pcre.htm (seems to be too old)
38Unpack it into pcre subdirectory.
39
40Perl module should be built using Makefile.PL.
41It is known to compile and work properly under Strawberry Perl.
42
43The C library can be built for Windows using CMake
44http://www.cmake.org/cmake/resources/software.html
45which has a GUI interface and can generate projects for
46# Visual Studio 6
47# Visual Studio 7
48# Visual Studio 7 .NET 2003
49# Visual Studio 8 2005
50# Visual Studio 8 2005 Win64
51# Visual Studio 9 2008
52# Visual Studio 9 2008 Win64
53# Watcom WMake
54# CodeBlocks - MinGW Makefiles
55# Eclipse CDT4 - MinGW Makefiles
56# Eclipse CDT4 - NMake Makefiles
57# Eclipse CDT4 - Unix Makefiles
58# Borland Makefiles
59# MSYS Makefiles
60# MinGW Makefiles
61# NMake Makefiles
62
63Also autotools-based minGW cross-compilation from linux to win32
64is also known to work. Maybe autotools-based cygwin and minGW 64
65compilation will work too, please, report your success.
66
67Example CMake usage.
68
69Unpack source tree. Run CMakeSetup.exe, set up path to the source tree,
70set up path to the build tree to the same value.
71press configure button, choose, for example,
72Visual Studio 9 2008. verify red-labelled configuration
73options. Change, for example, CMAKE_INSTALL_PREFIX.
74press configure button again, press generate button.
75Then open generated config in Visual Studio 9 2008
76and compile it.
77
78If you want to use another build system,
79be sure to define properly int64_type, used in EXPR internally.
80for list of possible defines consult CMakeLists.txt and configure.ac/config.h.in
81in the library source distribution.
82
83If you will try to complie this code on a win system,
84and will get a trouble, be so kind to send me a bugreport
85including logs of failed build.
86Note that I often have no place to test win32/win64 code,
87so patches are always welcome.
88
89