Permalink
Browse files

*** empty log message ***

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@23 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent e39913f commit 7dc261cc858ca61475f4b2a22bd99386b358400e @abw committed Jul 14, 2000
Showing with 389 additions and 59 deletions.
  1. +42 −0 Changes
  2. +11 −0 MANIFEST
  3. +66 −31 TODO
  4. +1 −1 lib/Template.pm
  5. +1 −0 lib/Template/Document.pm
  6. +53 −14 lib/Template/Provider.pm
  7. +1 −7 lib/Template/Service.pm
  8. +6 −5 lib/Template/Stash.pm
  9. +66 −0 t/compile4.t
  10. +77 −0 t/compile5.t
  11. +6 −1 t/document.t
  12. +56 −0 t/macro.t
  13. +3 −0 t/test/src/complex
View
42 Changes
@@ -12,6 +12,46 @@
# $Id$
#========================================================================
+#========================================================================
+# Changes from version 2.00-beta1 to 2.00-beta2
+#========================================================================
+
+* Added COMPILE_DIR option. This allows you to specify a separate
+ directory in which compiled templates should be written. The COMPILE_DIR
+ is used as a root directory and each of the INCLUDE_PATH elements is
+ created below that point. e.g. the following options
+
+ COMPILE_DIR => '/tmp/ttcache',
+ INCLUDE_PATH => '/user/foo/bar:/usr/share/templates',
+
+ would create the following cache directories:
+
+ /tmp/ttcache/user/foo/bar
+ /tmp/ttcache/usr/share/templates
+
+ Templates originating from source files in the INCLUDE_PATH are thus
+ written in their compiled form (i.e. Perl) to the relevant COMPILE_DIR
+ directory. The COMPILE_EXT option may also be used in conjunction with
+ COMPILE_DIR to append a filename extension to all compiled files.
+
+* Fixed memory leaks caused by the huge circular reference that is the
+ Template::Provider's linked list of cache slots. Added a DESTROY method
+ which walks the list and explicitly breaks the chains (i.e. the NEXT/PREV
+ links), thus allowing the compiled Template::Document objects to be
+ correctly destroyed and their memory repooled. Thanks to Perrin Harkins
+ for spotting the problem.
+
+* Added a work-around in Template::Stash _dotop() to the problem of the
+ CGI module denying membership of the UNIVERSAL class on subsequent calls
+ to UNIVERSAL::isa($cgi, 'UNIVERSAL'). It works correctly the first time,
+ but returns false for all subsequent calls. Changed this generic
+ "is-an-object" test to UNIVERSAL::can($cgi, 'can') on the suggestion
+ of Drew Taylor who identified the problem.
+
+* Added t/macro.t to test MACRO directive, t/compile4.t and t/compile5.t
+ to test the COMPILE_DIR option.
+
+* More complete documentation, but not yet fully complete.
#========================================================================
@@ -609,3 +649,5 @@ out.
* $Template::Directive::While::MAXITER is now
$Template::Directive::WHILE_MAX and may change again.
+
+
View
@@ -7,6 +7,7 @@ bin/README
bin/tpage
bin/ttree
docs/lib/author
+docs/lib/contents
docs/lib/copyright
docs/lib/exceptions
docs/lib/footer
@@ -16,6 +17,7 @@ docs/lib/option/cache
docs/lib/option/case
docs/lib/option/chomp
docs/lib/option/compile
+docs/lib/option/context
docs/lib/option/delim
docs/lib/option/error
docs/lib/option/evalperl
@@ -27,23 +29,29 @@ docs/lib/option/loadfilt
docs/lib/option/loadperl
docs/lib/option/loadplug
docs/lib/option/loadtmpl
+docs/lib/option/outpath
+docs/lib/option/output
docs/lib/option/parser
docs/lib/option/plugbase
docs/lib/option/plugins
docs/lib/option/preproc
docs/lib/option/relative
docs/lib/option/reset
+docs/lib/option/service
docs/lib/option/stash
docs/lib/option/tag
docs/lib/option/tagstyle
docs/lib/option/tolerant
docs/lib/option/trim
docs/lib/option/variables
docs/lib/option/version
+docs/lib/overview
docs/lib/plugins
docs/lib/ref/despat
docs/lib/revision
docs/lib/seealso
+docs/lib/summary
+docs/lib/synopsis
docs/lib/version
docs/pod/Base.pod
docs/pod/Config.pod
@@ -122,6 +130,8 @@ t/cgi.t
t/compile1.t
t/compile2.t
t/compile3.t
+t/compile4.t
+t/compile5.t
t/config.t
t/context.t
t/datafile.t
@@ -137,6 +147,7 @@ t/format.t
t/include.t
t/iterator.t
t/list.t
+t/macro.t
t/object.t
t/output.t
t/parser.t
View
97 TODO
@@ -1,38 +1,53 @@
-===========================================
-It's a real mess in here. Don't even look.
-===========================================
-
-TODO
-----
+#------------------------------------------------------------------------
+# TO-DO
+#------------------------------------------------------------------------
* move v1 Template::* to Template::v1::*. Add 'version1' load flag
as an EXPORT_FAIL to Tempate.pm to load v1.
* Add :preload use option to Template.pm to preload all modules. Or should
it be :noload and have preload by default?
-* Note that \refs are not supported. I don't know if they ever should
- be, but I think that some of the problems for which refs were conceived
- are still valid.
-
-* Alternate parser back end which bypasses the stash, based on Doug's code.
+* Alternate parser back end which bypasses the stash, based on Doug
+ Steinwand's code. The V2 generated Perl code is much faster than V1
+ but still falls short of what Doug has shown is possible. His
+ parser gets the massive speed-up by bypassing the stash altogether
+ (which in V1 was particularly hideous) and directly generating code
+ to walk the stash structure and do the right thing. A little magic
+ was lost, so for this version I've stuck with the full-blown stash
+ approach which provides all the magic for backwards compatibility,
+ albeit at some trade-off in speed. Nevertheless, compiled V2
+ templates should easily run twice as fast as under V1. My current
+ idea is to re-write the parser to generate more explicit stash
+ navigation code which uses direct access where the type can be
+ grokked in advanced (i.e. a NUMBER implies the parent is an ARRAY).
+ I'm also in favour of propose adding the '->' operator as a clue to
+ the parser to do direct access rather than stash access.
+ e.g.
+ [% something->first %] => $stash->{'something'}->{'first'}
+ [% something.first %] => $stash->get('something', 0, 'first', 0)
+
+ The second example is as per the current V2 bet and allows
+ 'something' to be either a hash with a 'first' member (which may be
+ a sub-routine which is then run), or an object with a 'first'
+ method, or a list from which the first item is returned. All magic
+ is intact. The first example runs much faster and in those cases
+ when you know you haven't got any magical variables, this is a
+ Good Thing. Doug used a combination of -> and () to give enough
+ clues to Do The Right Thing most of the time, so I'm hoping that
+ we will be able to incorporate some of those ideas soon.
+
+* Alternative parser front-end written in C/YACC. This is entirely feasible
+ now that we only have to transform the input text (template) to
+ output text (Perl) and don't have to build any significant Perl
+ structure. It's not entirely trivial - the scanner in particular has
+ to handle CHOMP options and user-definable TAGS, but it's certainly
+ possible.
* A 'FOR', like 'FOREACH' but without using an iterator. You wouldn't get
the 'loop' reference to test 'first', 'last', etc., against, but it would
be faster for those cases when you didn't need that.
-* Memory leaks (there's something creating circular references and it's
- probably glaringly obvious but I haven't bothered to look yet) (time
- passes... I've bothered to look now - it looks like the Template::Provider
- but I haven't bothered to fix it yet)
-
-* Change ttree to have knowledge of new config options.
-
-* Improve tpage to do the same (i.e. have --define, at least)
-
-* A COMPILE_DIR option to compliment COMPILE_EXT, specifying an alternate
- directory in which to store compiled template documents.
-
* Change filter factory interface to accept $context as first parameter.
Dynamic dynamic filters can't grab context reference and some of them
need it.
@@ -42,9 +57,17 @@ TODO
* Filters and plugins cache may bloat. Perhaps reset() should accept
flags to clear BLOCKS, PLUGINS, FILTERS, etc.
+* Change ttree to have knowledge of new config options.
+
+* Improve tpage to do the same (i.e. have --define, at least)
+
+* Note that \refs are not supported. I don't know if they ever should
+ be, but I think that some of the problems for which refs were conceived
+ are still valid.
+
* Do something (i.e. mail Lincoln) about the CGI special case in
Template::Stash to work around the problem of CGI objects disclaiming
- membership of the UNVIERSAL class after the first method call.
+ membership of the UNIVERSAL class after the first method call.
* Note that no recursion checking is performed for BLOCKs, only
Template::Document instances. Should be documented.
@@ -55,19 +78,17 @@ TODO
DONT_USE_CACHE, DONT_CACHE, DONT_COMPILE. Or should there be public
interfaces for load(), compile(), etc.? Not sure.
-* should output redirection be handled by the service rather than
- Template.pm?
-
* change all hardcoded object isa tests to use $Template::Config:XXXXX
e.g. if (UNIVERSAL::isa($foo, $Template::Config::CONTEXT))
-* check [% INCLUDE $template %] works where $template is a Template::Document
-
* merge Directive into Parse.yp via template process?
+#------------------------------------------------------------------------
+# TO-DONE
+#------------------------------------------------------------------------
--- TODONE --
+-- v2.00 beta 1 --
* Template::Context include()/process() should work with raw CODE refs.
@@ -97,7 +118,8 @@ TODO
* block persistance - sometimes need to define BLOCKs that persist
through service invocations (AUTO_RESET => 0).
-* fix \@ quoting (and others) in Directive (Perrin reported / Chuck patched)
+* fix \@ quoting (and others) in Directive (Perrin Harkins reported / Chuck
+ Adams patched)
* Added Date plugin and test, as provided by Thierry-Michel Barral and abw.
@@ -135,3 +157,16 @@ TODO
in consistency with [% CATCH DEFAULT %] / [% CATCH %]
+-- v2.00 beta 2 --
+
+* A COMPILE_DIR option to compliment COMPILE_EXT, specifying an alternate
+ directory in which to store compiled template documents.
+
+* Memory leaks (there's something creating circular references and it's
+ probably glaringly obvious but I haven't bothered to look yet) (time
+ passes... I've bothered to look now - it looks like the Template::Provider
+ but I haven't bothered to fix it yet) (more time passes... now I have)
+
+* check [% INCLUDE $template %] works where $template is a
+ Template::Document
+
View
@@ -39,7 +39,7 @@ use File::Path;
## This is the main version number for the Template Toolkit.
## It is extracted by ExtUtils::MakeMaker and inserted in various places.
-$VERSION = '2.00-beta1';
+$VERSION = '2.00-beta2';
$ERROR = '';
$DEBUG = 0;
View
@@ -157,6 +157,7 @@ sub AUTOLOAD {
return $self->{ $method };
}
+
#========================================================================
# ----- PRIVATE METHODS -----
#========================================================================
Oops, something went wrong.

0 comments on commit 7dc261c

Please sign in to comment.