Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B65AAC8F6 for ; Tue, 22 May 2012 14:43:11 +0000 (UTC) Received: (qmail 41271 invoked by uid 500); 22 May 2012 14:43:11 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 41244 invoked by uid 500); 22 May 2012 14:43:11 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 41237 invoked by uid 99); 22 May 2012 14:43:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 14:43:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_FOLLOW1,T_FRT_FOLLOW2 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 14:43:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8FE8B2388980; Tue, 22 May 2012 14:42:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1341499 [1/7] - in /logging/site/branches/experimental-twig-textile: ./ libs/Twig/ libs/Twig/lib/ libs/Twig/lib/Twig/ libs/Twig/lib/Twig/Error/ libs/Twig/lib/Twig/Extension/ libs/Twig/lib/Twig/Filter/ libs/Twig/lib/Twig/Function/ libs/Twig... Date: Tue, 22 May 2012 14:42:31 -0000 To: commits@logging.apache.org From: ihabunek@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120522144238.8FE8B2388980@eris.apache.org> Author: ihabunek Date: Tue May 22 14:42:25 2012 New Revision: 1341499 URL: http://svn.apache.org/viewvc?rev=1341499&view=rev Log: Bundled Twig library into the project. Updated build script accordingly. Added: logging/site/branches/experimental-twig-textile/libs/Twig/ logging/site/branches/experimental-twig-textile/libs/Twig/.travis.yml logging/site/branches/experimental-twig-textile/libs/Twig/AUTHORS logging/site/branches/experimental-twig-textile/libs/Twig/CHANGELOG logging/site/branches/experimental-twig-textile/libs/Twig/LICENSE logging/site/branches/experimental-twig-textile/libs/Twig/README.markdown logging/site/branches/experimental-twig-textile/libs/Twig/composer.json logging/site/branches/experimental-twig-textile/libs/Twig/lib/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Autoloader.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Compiler.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/CompilerInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Environment.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Error/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Error.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Error/Loader.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Error/Runtime.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Error/Syntax.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/ExpressionParser.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/Core.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/Debug.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/Escaper.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/Optimizer.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Extension/Sandbox.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/ExtensionInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Filter/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Filter.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Filter/Function.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Filter/Method.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Filter/Node.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/FilterInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Function/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Function.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Function/Function.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Function/Method.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Function/Node.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/FunctionInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Lexer.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/LexerInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Loader/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Loader/Array.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Loader/Chain.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Loader/Filesystem.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Loader/String.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/LoaderInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Markup.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/AutoEscape.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Block.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/BlockReference.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Body.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Do.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Embed.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Array.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/AssignName.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Add.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/And.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Concat.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Div.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Equal.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/FloorDiv.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Greater.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/In.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Less.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/LessEqual.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Mod.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Mul.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/NotEqual.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/NotIn.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Or.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Power.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Range.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Binary/Sub.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/BlockReference.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Conditional.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Constant.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/ExtensionReference.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Filter/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Filter.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Filter/Default.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Function.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/GetAttr.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/MethodCall.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Name.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Parent.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/TempName.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Constant.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Defined.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Divisibleby.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Even.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Null.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Odd.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Test/Sameas.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Unary/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Unary.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Unary/Neg.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Unary/Not.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Expression/Unary/Pos.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Flush.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/For.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/ForLoop.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/If.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Import.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Include.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Macro.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Module.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Print.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Sandbox.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/SandboxedModule.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/SandboxedPrint.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Set.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/SetTemp.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Spaceless.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Node/Text.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeOutputInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeTraverser.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitor/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitor/Escaper.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitor/Optimizer.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitor/SafeAnalysis.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitor/Sandbox.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/NodeVisitorInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Parser.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/ParserInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Sandbox/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Sandbox/SecurityError.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Sandbox/SecurityPolicy.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Sandbox/SecurityPolicyInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Template.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TemplateInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Test/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Test/Function.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Test/Method.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Test/Node.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TestInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Token.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/AutoEscape.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Block.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Do.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Embed.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Extends.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Filter.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Flush.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/For.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/From.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/If.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Import.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Include.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Macro.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Sandbox.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Set.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Spaceless.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParser/Use.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParserBroker.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParserBrokerInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenParserInterface.php logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/TokenStream.php logging/site/branches/experimental-twig-textile/libs/Twig/package.xml.tpl logging/site/branches/experimental-twig-textile/libs/Twig/phpunit.xml.dist Modified: logging/site/branches/experimental-twig-textile/build.php Modified: logging/site/branches/experimental-twig-textile/build.php URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/build.php?rev=1341499&r1=1341498&r2=1341499&view=diff ============================================================================== --- logging/site/branches/experimental-twig-textile/build.php (original) +++ logging/site/branches/experimental-twig-textile/build.php Tue May 22 14:42:25 2012 @@ -19,16 +19,18 @@ // -- Config ------------------------------------ -define('PAGES_DIR', "src/site/pages/"); -define('RESOURCES_DIR', "src/site/resources/"); -define('TEMPLATES_DIR', "src/site/templates/"); -define('TARGET_DIR', "target/site/"); -define('POM_PATH', "pom.xml"); +$base = dirname(__FILE__); + +define('PAGES_DIR', "$base/src/site/pages/"); +define('RESOURCES_DIR', "$base/src/site/resources/"); +define('TEMPLATES_DIR', "$base/src/site/templates/"); +define('TARGET_DIR', "$base/target/site/"); +define('POM_PATH', "$base/pom.xml"); // -- Init -------------------------------------- -require 'Twig/Autoloader.php'; -require 'libs/textile/classTextile.php'; +require "$base/libs/Twig/lib/Twig/Autoloader.php"; +require "$base/libs/textile/classTextile.php"; // Configure twig Twig_Autoloader::register(); Added: logging/site/branches/experimental-twig-textile/libs/Twig/.travis.yml URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/.travis.yml?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/.travis.yml (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/.travis.yml Tue May 22 14:42:25 2012 @@ -0,0 +1,14 @@ +language: php + +php: + - 5.2 + - 5.3 + - 5.4 + +env: + - TWIG_EXT=no + - TWIG_EXT=yes + +before_script: + - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && sudo make install"; fi + - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi Added: logging/site/branches/experimental-twig-textile/libs/Twig/AUTHORS URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/AUTHORS?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/AUTHORS (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/AUTHORS Tue May 22 14:42:25 2012 @@ -0,0 +1,9 @@ +Twig is written and maintained by the Twig Team: + +Lead Developer: + +- Fabien Potencier + +Project Founder: + +- Armin Ronacher Added: logging/site/branches/experimental-twig-textile/libs/Twig/CHANGELOG URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/CHANGELOG?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/CHANGELOG (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/CHANGELOG Tue May 22 14:42:25 2012 @@ -0,0 +1,507 @@ +* 1.8.1 (2012-05-17) + + * fixed a regression when dealing with SimpleXMLElement instances in templates + * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini + * switched to use mbstring whenever possible instead of iconv + +* 1.8.0 (2012-05-08) + + * enforced interface when adding tests, filters, functions, and node visitors from extensions + * fixed a side-effect of the date filter where the timezone might be changed + * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) + * added a way to dynamically change the auto-escaping strategy according to the template "filename" + * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) + * added an embed tag + +* 1.7.0 (2012-04-24) + + * fixed a PHP warning when using CIFS + * fixed template line number in some exceptions + * added an iterable test + * added an error when defining two blocks with the same name in a template + * added the preserves_safety option for filters + * fixed a PHP notice when trying to access a key on a non-object/array variable + * enhanced error reporting when the template file is an instance of SplFileInfo + * added Twig_Environment::mergeGlobals() + * added compilation checks to avoid misuses of the sandbox tag + * fixed filesystem loader freshness logic for high traffic websites + * fixed random function when charset is null + +* 1.6.5 (2012-04-11) + + * fixed a regression when a template only extends another one without defining any blocks + +* 1.6.4 (2012-04-02) + + * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 + * fixed performance when compiling large files + * optimized parent template creation when the template does not use dynamic inheritance + +* 1.6.3 (2012-03-22) + + * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension + * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot + * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate + +* 1.6.2 (2012-03-18) + + * fixed sandbox mode when used with inheritance + * added preserveKeys support for the slice filter + * fixed the date filter when a DateTime instance is passed with a specific timezone + * added a trim filter + +* 1.6.1 (2012-02-29) + + * fixed Twig C extension + * removed the creation of Twig_Markup instances when not needed + * added a way to set the default global timezone for dates + * fixed the slice filter on strings when the length is not specified + * fixed the creation of the cache directory in case of a race condition + +* 1.6.0 (2012-02-04) + + * fixed raw blocks when used with the whitespace trim option + * made a speed optimization to macro calls when imported via the "from" tag + * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added + * fixed the attribute function when passing arguments + * added slice notation support for the [] operator (syntactic sugar for the slice operator) + * added a slice filter + * added string support for the reverse filter + * fixed the empty test and the length filter for Twig_Markup instances + * added a date function to ease date comparison + * fixed unary operators precedence + * added recursive parsing support in the parser + * added string and integer handling for the random function + +* 1.5.1 (2012-01-05) + + * fixed a regression when parsing strings + +* 1.5.0 (2012-01-04) + + * added Traversable objects support for the join filter + +* 1.5.0-RC2 (2011-12-30) + + * added a way to set the default global date interval format + * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) + * refactored Twig_Template::display() to ease its extension + * added a number_format filter + +* 1.5.0-RC1 (2011-12-26) + + * removed the need to quote hash keys + * allowed hash keys to be any expression + * added a do tag + * added a flush tag + * added support for dynamically named filters and functions + * added a dump function to help debugging templates + * added a nl2br filter + * added a random function + * added a way to change the default format for the date filter + * fixed the lexer when an operator ending with a letter ends a line + * added string interpolation support + * enhanced exceptions for unknown filters, functions, tests, and tags + +* 1.4.0 (2011-12-07) + + * fixed lexer when using big numbers (> PHP_INT_MAX) + * added missing preserveKeys argument to the reverse filter + * fixed macros containing filter tag calls + +* 1.4.0-RC2 (2011-11-27) + + * removed usage of Reflection in Twig_Template::getAttribute() + * added a C extension that can optionally replace Twig_Template::getAttribute() + * added negative timestamp support to the date filter + +* 1.4.0-RC1 (2011-11-20) + + * optimized variable access when using PHP 5.4 + * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby + * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders + * added Twig_Function_Node to allow more complex functions to have their own Node class + * added Twig_Filter_Node to allow more complex filters to have their own Node class + * added Twig_Test_Node to allow more complex tests to have their own Node class + * added a better error message when a template is empty but contain a BOM + * fixed "in" operator for empty strings + * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) + * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) + * added Twig_Environment::display() + * made the escape filter smarter when the encoding is not supported by PHP + * added a convert_encoding filter + * moved all node manipulations outside the compile() Node method + * made several speed optimizations + +* 1.3.0 (2011-10-08) + +no changes + +* 1.3.0-RC1 (2011-10-04) + + * added an optimization for the parent() function + * added cache reloading when auto_reload is true and an extension has been modified + * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) + * allowed empty templates to be used as traits + * added traits support for the "parent" function + +* 1.2.0 (2011-09-13) + +no changes + +* 1.2.0-RC1 (2011-09-10) + + * enhanced the exception when a tag remains unclosed + * added support for empty Countable objects for the "empty" test + * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) + * added better support for encoding problems when escaping a string (available as of PHP 5.4) + * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) + * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) + * added support for bitwise operators in expressions + * added the "attribute" function to allow getting dynamic attributes on variables + * added Twig_Loader_Chain + * added Twig_Loader_Array::setTemplate() + * added an optimization for the set tag when used to capture a large chunk of static text + * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) + * removed the possibility to use the "extends" tag from a block + * added "if" modifier support to "for" loops + +* 1.1.2 (2011-07-30) + + * fixed json_encode filter on PHP 5.2 + * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) + * fixed inheritance when using conditional parents + * fixed compilation of templates when the body of a child template is not empty + * fixed output when a macro throws an exception + * fixed a parsing problem when a large chunk of text is enclosed in a comment tag + * added PHPDoc for all Token parsers and Core extension functions + +* 1.1.1 (2011-07-17) + + * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) + * made some performance improvement for some edge cases + +* 1.1.0 (2011-06-28) + + * fixed json_encode filter + +* 1.1.0-RC3 (2011-06-24) + + * fixed method case-sensitivity when using the sandbox mode + * added timezone support for the date filter + * fixed possible security problems with NUL bytes + +* 1.1.0-RC2 (2011-06-16) + + * added an exception when the template passed to "use" is not a string + * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) + * added {% line \d+ %} directive + +* 1.1.0-RC1 (2011-05-28) + +Flush your cache after upgrading. + + * fixed date filter when using a timestamp + * fixed the defined test for some cases + * fixed a parsing problem when a large chunk of text is enclosed in a raw tag + * added support for horizontal reuse of template blocks (see docs for more information) + * added whitespace control modifier to all tags (see docs for more information) + * added null as an alias for none (the null test is also an alias for the none test now) + * made TRUE, FALSE, NONE equivalent to their lowercase counterparts + * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line + * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) + +* 1.0.0 (2011-03-27) + + * fixed output when using mbstring + * fixed duplicate call of methods when using the sandbox + * made the charset configurable for the escape filter + +* 1.0.0-RC2 (2011-02-21) + + * changed the way {% set %} works when capturing (the content is now marked as safe) + * added support for macro name in the endmacro tag + * make Twig_Error compatible with PHP 5.3.0 > + * fixed an infinite loop on some Windows configurations + * fixed the "length" filter for numbers + * fixed Template::getAttribute() as properties in PHP are case sensitive + * removed coupling between Twig_Node and Twig_Template + * fixed the ternary operator precedence rule + +* 1.0.0-RC1 (2011-01-09) + +Backward incompatibilities: + + * the "items" filter, which has been deprecated for quite a long time now, has been removed + * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) + * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} + * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} + * the "for" tag does not support "joined by" anymore + * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") + * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) + * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) + * removed the grammar and simple token parser (moved to the Twig Extensions repository) + +Changes: + + * added "needs_context" option for filters and functions (the context is then passed as a first argument) + * added global variables support + * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) + * added the "from" tag to import macros as functions + * added support for functions (a function is just syntactic sugar for a getAttribute() call) + * made macros callable when sandbox mode is enabled + * added an exception when a macro uses a reserved name + * the "default" filter now uses the "empty" test instead of just checking for null + * added the "empty" test + +* 0.9.10 (2010-12-16) + +Backward incompatibilities: + + * The Escaper extension is enabled by default, which means that all displayed + variables are now automatically escaped. You can revert to the previous + behavior by removing the extension via $env->removeExtension('escaper') + or just set the 'autoescape' option to 'false'. + * removed the "without loop" attribute for the "for" tag (not needed anymore + as the Optimizer take care of that for most cases) + * arrays and hashes have now a different syntax + * arrays keep the same syntax with square brackets: [1, 2] + * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) + * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) + * the i18n extension is now part of the Twig Extensions repository + +Changes: + + * added the merge filter + * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead + * fixed usage of operators as method names (like is, in, and not) + * changed the order of execution for node visitors + * fixed default() filter behavior when used with strict_variables set to on + * fixed filesystem loader compatibility with PHAR files + * enhanced error messages when an unexpected token is parsed in an expression + * fixed filename not being added to syntax error messages + * added the autoescape option to enable/disable autoescaping + * removed the newline after a comment (mimicks PHP behavior) + * added a syntax error exception when parent block is used on a template that does not extend another one + * made the Escaper extension enabled by default + * fixed sandbox extension when used with auto output escaping + * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) + * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) + * added priority to node visitors + +* 0.9.9 (2010-11-28) + +Backward incompatibilities: + * the self special variable has been renamed to _self + * the odd and even filters are now tests: + {{ foo|odd }} must now be written {{ foo is odd }} + * the "safe" filter has been renamed to "raw" + * in Node classes, + sub-nodes are now accessed via getNode() (instead of property access) + attributes via getAttribute() (instead of array access) + * the urlencode filter had been renamed to url_encode + * the include tag now merges the passed variables with the current context by default + (the old behavior is still possible by adding the "only" keyword) + * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) + * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) + * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) + +Changes: + * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template + * changed trans tag to accept any variable for the plural count + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) + * added the ** (power) operator + * changed the algorithm used for parsing expressions + * added the spaceless tag + * removed trim_blocks option + * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) + * changed all exceptions to extend Twig_Error + * fixed unary expressions ({{ not(1 or 0) }}) + * fixed child templates (with an extend tag) that uses one or more imports + * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) + * escaping has been rewritten + * the implementation of template inheritance has been rewritten + (blocks can now be called individually and still work with inheritance) + * fixed error handling for if tag when a syntax error occurs within a subparse process + * added a way to implement custom logic for resolving token parsers given a tag name + * fixed js escaper to be stricter (now uses a whilelist-based js escaper) + * added the following filers: "constant", "trans", "replace", "json_encode" + * added a "constant" test + * fixed objects with __toString() not being autoescaped + * fixed subscript expressions when calling __call() (methods now keep the case) + * added "test" feature (accessible via the "is" operator) + * removed the debug tag (should be done in an extension) + * fixed trans tag when no vars are used in plural form + * fixed race condition when writing template cache + * added the special _charset variable to reference the current charset + * added the special _context variable to reference the current context + * renamed self to _self (to avoid conflict) + * fixed Twig_Template::getAttribute() for protected properties + +* 0.9.8 (2010-06-28) + +Backward incompatibilities: + * the trans tag plural count is now attached to the plural tag: + old: `{% trans count %}...{% plural %}...{% endtrans %}` + new: `{% trans %}...{% plural count %}...{% endtrans %}` + + * added a way to translate strings coming from a variable ({% trans var %}) + * fixed trans tag when used with the Escaper extension + * fixed default cache umask + * removed Twig_Template instances from the debug tag output + * fixed objects with __isset() defined + * fixed set tag when used with a capture + * fixed type hinting for Twig_Environment::addFilter() method + +* 0.9.7 (2010-06-12) + +Backward incompatibilities: + * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) + * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) + * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) + + * added self as a special variable that refers to the current template (useful for importing macros from the current template) + * added Twig_Template instance support to the include tag + * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) + * added a grammar sub-framework to ease the creation of custom tags + * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) + * removed the Twig_Resource::resolveMissingFilter() method + * fixed the filter tag which did not apply filtering to included files + * added a bunch of unit tests + * added a bunch of phpdoc + * added a sandbox tag in the sandbox extension + * changed the date filter to support any date format supported by DateTime + * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) + * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor + * changed the cache option to only accepts an explicit path to a cache directory or false + * added a way to add token parsers, filters, and visitors without creating an extension + * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface + * changed the generated code to match the new coding standards + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) + * added an exception when a child template has a non-empty body (as it is always ignored when rendering) + +* 0.9.6 (2010-05-12) + + * fixed variables defined outside a loop and for which the value changes in a for loop + * fixed the test suite for PHP 5.2 and older versions of PHPUnit + * added support for __call() in expression resolution + * fixed node visiting for macros (macros are now visited by visitors as any other node) + * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) + * added the cycle filter + * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII + * added a long-syntax for the set tag ({% set foo %}...{% endset %}) + * unit tests are now powered by PHPUnit + * added support for gettext via the `i18n` extension + * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values + * added a more useful exception if an if tag is not closed properly + * added support for escaping strategy in the autoescape tag + * fixed lexer when a template has a big chunk of text between/in a block + +* 0.9.5 (2010-01-20) + +As for any new release, don't forget to remove all cached templates after +upgrading. + +If you have defined custom filters, you MUST upgrade them for this release. To +upgrade, replace "array" with "new Twig_Filter_Function", and replace the +environment constant by the "needs_environment" option: + + // before + 'even' => array('twig_is_even_filter', false), + 'escape' => array('twig_escape_filter', true), + + // after + 'even' => new Twig_Filter_Function('twig_is_even_filter'), + 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), + +If you have created NodeTransformer classes, you will need to upgrade them to +the new interface (please note that the interface is not yet considered +stable). + + * fixed list nodes that did not extend the Twig_NodeListInterface + * added the "without loop" option to the for tag (it disables the generation of the loop variable) + * refactored node transformers to node visitors + * fixed automatic-escaping for blocks + * added a way to specify variables to pass to an included template + * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) + * improved the filter system to allow object methods to be used as filters + * changed the Array and String loaders to actually make use of the cache mechanism + * included the default filter function definitions in the extension class files directly (Core, Escaper) + * added the // operator (like the floor() PHP function) + * added the .. operator (as a syntactic sugar for the range filter when the step is 1) + * added the in operator (as a syntactic sugar for the in filter) + * added the following filters in the Core extension: in, range + * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) + * enhanced some error messages to provide better feedback in case of parsing errors + +* 0.9.4 (2009-12-02) + +If you have custom loaders, you MUST upgrade them for this release: The +Twig_Loader base class has been removed, and the Twig_LoaderInterface has also +been changed (see the source code for more information or the documentation). + + * added support for DateTime instances for the date filter + * fixed loop.last when the array only has one item + * made it possible to insert newlines in tag and variable blocks + * fixed a bug when a literal '\n' were present in a template text + * fixed bug when the filename of a template contains */ + * refactored loaders + +* 0.9.3 (2009-11-11) + +This release is NOT backward compatible with the previous releases. + + The loaders do not take the cache and autoReload arguments anymore. Instead, + the Twig_Environment class has two new options: cache and auto_reload. + Upgrading your code means changing this kind of code: + + $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); + $twig = new Twig_Environment($loader); + + to something like this: + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'cache' => '/path/to/compilation_cache', + 'auto_reload' => true, + )); + + * deprecated the "items" filter as it is not needed anymore + * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader + * optimized template loading speed + * removed output when an error occurs in a template and render() is used + * made major speed improvements for loops (up to 300% on even the smallest loops) + * added properties as part of the sandbox mode + * added public properties support (obj.item can now be the item property on the obj object) + * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) + * fixed bug when \ was used in HTML + +* 0.9.2 (2009-10-29) + + * made some speed optimizations + * changed the cache extension to .php + * added a js escaping strategy + * added support for short block tag + * changed the filter tag to allow chained filters + * made lexer more flexible as you can now change the default delimiters + * added set tag + * changed default directory permission when cache dir does not exist (more secure) + * added macro support + * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance + * made Twig_Autoloader::autoload() a static method + * avoid writing template file if an error occurs + * added $ escaping when outputting raw strings + * enhanced some error messages to ease debugging + * fixed empty cache files when the template contains an error + +* 0.9.1 (2009-10-14) + + * fixed a bug in PHP 5.2.6 + * fixed numbers with one than one decimal + * added support for method calls with arguments ({{ foo.bar('a', 43) }}) + * made small speed optimizations + * made minor tweaks to allow better extensibility and flexibility + +* 0.9.0 (2009-10-12) + + * Initial release Added: logging/site/branches/experimental-twig-textile/libs/Twig/LICENSE URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/LICENSE?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/LICENSE (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/LICENSE Tue May 22 14:42:25 2012 @@ -0,0 +1,31 @@ +Copyright (c) 2009 by the Twig Team, see AUTHORS for more details. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: logging/site/branches/experimental-twig-textile/libs/Twig/README.markdown URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/README.markdown?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/README.markdown (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/README.markdown Tue May 22 14:42:25 2012 @@ -0,0 +1,17 @@ +Twig, the flexible, fast, and secure template language for PHP +============================================================== + +[![Build Status](https://secure.travis-ci.org/fabpot/Twig.png?branch=master)](http://travis-ci.org/fabpot/Twig) + +Twig is a template language for PHP, released under the new BSD license (code +and documentation). + +Twig uses a syntax similar to the Django and Jinja template languages which +inspired the Twig runtime environment. + +More Information +---------------- + +Read the [documentation][1] for more information. + +[1]: http://twig.sensiolabs.org/documentation Added: logging/site/branches/experimental-twig-textile/libs/Twig/composer.json URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/composer.json?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/composer.json (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/composer.json Tue May 22 14:42:25 2012 @@ -0,0 +1,31 @@ +{ + "name": "twig/twig", + "type": "library", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "keywords": ["templating"], + "homepage": "http://twig.sensiolabs.org", + "license": "BSD-3", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com" + } + ], + "require": { + "php": ">=5.2.4" + }, + "autoload": { + "psr-0" : { + "Twig_" : "lib/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + } +} Added: logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Autoloader.php URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Autoloader.php?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Autoloader.php (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Autoloader.php Tue May 22 14:42:25 2012 @@ -0,0 +1,46 @@ + + */ +class Twig_Autoloader +{ + /** + * Registers Twig_Autoloader as an SPL autoloader. + */ + static public function register() + { + ini_set('unserialize_callback_func', 'spl_autoload_call'); + spl_autoload_register(array(new self, 'autoload')); + } + + /** + * Handles autoloading of classes. + * + * @param string $class A class name. + * + * @return boolean Returns true if the class has been loaded + */ + static public function autoload($class) + { + if (0 !== strpos($class, 'Twig')) { + return; + } + + if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) { + require $file; + } + } +} Added: logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Compiler.php URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Compiler.php?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Compiler.php (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/Compiler.php Tue May 22 14:42:25 2012 @@ -0,0 +1,242 @@ + + */ +class Twig_Compiler implements Twig_CompilerInterface +{ + protected $lastLine; + protected $source; + protected $indentation; + protected $env; + protected $debugInfo; + protected $sourceOffset; + protected $sourceLine; + + /** + * Constructor. + * + * @param Twig_Environment $env The twig environment instance + */ + public function __construct(Twig_Environment $env) + { + $this->env = $env; + $this->debugInfo = array(); + } + + /** + * Returns the environment instance related to this compiler. + * + * @return Twig_Environment The environment instance + */ + public function getEnvironment() + { + return $this->env; + } + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource() + { + return $this->source; + } + + /** + * Compiles a node. + * + * @param Twig_NodeInterface $node The node to compile + * @param integer $indentation The current indentation + * + * @return Twig_Compiler The current compiler instance + */ + public function compile(Twig_NodeInterface $node, $indentation = 0) + { + $this->lastLine = null; + $this->source = ''; + $this->sourceOffset = 0; + $this->sourceLine = 0; + $this->indentation = $indentation; + + $node->compile($this); + + return $this; + } + + public function subcompile(Twig_NodeInterface $node, $raw = true) + { + if (false === $raw) { + $this->addIndentation(); + } + + $node->compile($this); + + return $this; + } + + /** + * Adds a raw string to the compiled code. + * + * @param string $string The string + * + * @return Twig_Compiler The current compiler instance + */ + public function raw($string) + { + $this->source .= $string; + + return $this; + } + + /** + * Writes a string to the compiled code by adding indentation. + * + * @return Twig_Compiler The current compiler instance + */ + public function write() + { + $strings = func_get_args(); + foreach ($strings as $string) { + $this->addIndentation(); + $this->source .= $string; + } + + return $this; + } + + public function addIndentation() + { + $this->source .= str_repeat(' ', $this->indentation * 4); + + return $this; + } + + /** + * Adds a quoted string to the compiled code. + * + * @param string $value The string + * + * @return Twig_Compiler The current compiler instance + */ + public function string($value) + { + $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); + + return $this; + } + + /** + * Returns a PHP representation of a given value. + * + * @param mixed $value The value to convert + * + * @return Twig_Compiler The current compiler instance + */ + public function repr($value) + { + if (is_int($value) || is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, 0)) { + setlocale(LC_NUMERIC, 'C'); + } + + $this->raw($value); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { + $this->raw('null'); + } elseif (is_bool($value)) { + $this->raw($value ? 'true' : 'false'); + } elseif (is_array($value)) { + $this->raw('array('); + $i = 0; + foreach ($value as $key => $value) { + if ($i++) { + $this->raw(', '); + } + $this->repr($key); + $this->raw(' => '); + $this->repr($value); + } + $this->raw(')'); + } else { + $this->string($value); + } + + return $this; + } + + /** + * Adds debugging information. + * + * @param Twig_NodeInterface $node The related twig node + * + * @return Twig_Compiler The current compiler instance + */ + public function addDebugInfo(Twig_NodeInterface $node) + { + if ($node->getLine() != $this->lastLine) { + $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); + $this->sourceOffset = strlen($this->source); + $this->debugInfo[$this->sourceLine] = $node->getLine(); + + $this->lastLine = $node->getLine(); + $this->write("// line {$node->getLine()}\n"); + } + + return $this; + } + + public function getDebugInfo() + { + return $this->debugInfo; + } + + /** + * Indents the generated code. + * + * @param integer $step The number of indentation to add + * + * @return Twig_Compiler The current compiler instance + */ + public function indent($step = 1) + { + $this->indentation += $step; + + return $this; + } + + /** + * Outdents the generated code. + * + * @param integer $step The number of indentation to remove + * + * @return Twig_Compiler The current compiler instance + */ + public function outdent($step = 1) + { + $this->indentation -= $step; + + if ($this->indentation < 0) { + throw new Twig_Error('Unable to call outdent() as the indentation would become negative'); + } + + return $this; + } +} Added: logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/CompilerInterface.php URL: http://svn.apache.org/viewvc/logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/CompilerInterface.php?rev=1341499&view=auto ============================================================================== --- logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/CompilerInterface.php (added) +++ logging/site/branches/experimental-twig-textile/libs/Twig/lib/Twig/CompilerInterface.php Tue May 22 14:42:25 2012 @@ -0,0 +1,35 @@ + + */ +interface Twig_CompilerInterface +{ + /** + * Compiles a node. + * + * @param Twig_NodeInterface $node The node to compile + * + * @return Twig_CompilerInterface The current compiler instance + */ + function compile(Twig_NodeInterface $node); + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + function getSource(); +}