History
Version f9e789948346197f6543892b94efb3e60cec62da
at Sunday 18 April 2010 11:59:08 UTC Fixed parsing of function/constants that start with an underscore, thanks to Dominik del Bondio for the patch Fixes #68Version cb80c435bb20fa06b4fa3a18bae45a04f990eca9
at Sunday 7 March 2010 20:58:29 UTC Added {return} plugin that allows any included template to return variables into the one that included it, or to the main controller code via $dwoo->getReturnValues() Fixes #59 git-svn-id: http://svn.dwoo.org/trunk@346 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e3129dcf28fdc8b93a0f7a67c68ff2269562c360
at Sunday 7 February 2010 17:14:07 UTC Docs 1.1.1 git-svn-id: http://svn.dwoo.org/trunk@334 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e34cfa7548ac1ff50474a688933f2a71f1b14d73
at Sunday 7 February 2010 16:43:23 UTC Prep release 1.1.1 git-svn-id: http://svn.dwoo.org/trunk@333 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cb3c2b55a8ec9c64a997962d2696d198b2f23a2e
at Tuesday 19 January 2010 00:26:05 UTC Allow custom plugins to be called from within sub-templates, fixes #51 git-svn-id: http://svn.dwoo.org/trunk@323 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c417fe27ea22dd1ab1f2a8065d5e1f424c198071
at Monday 18 January 2010 23:40:23 UTC unify line endings to LF and set svn:eol-style to native on all files git-svn-id: http://svn.dwoo.org/trunk@322 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f65127b40b8bdc2ffceee92c7ec4238ed27bc2c5
at Friday 8 January 2010 13:24:25 UTC Fixed a bug in {safe} when using variable-variables it would sometimes corrupt the var name resulting in blank output git-svn-id: http://svn.dwoo.org/trunk@320 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cf4be68ff0760ee3c329fd295a625be1925dacef
at Monday 23 November 2009 15:45:26 UTC fixes loading of plugins within dynamic blocks git-svn-id: http://svn.dwoo.org/trunk@313 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion eee94489a9c8fe377563b0fd1ea7aa9be78a17c1
at Sunday 22 November 2009 23:15:39 UTC merging r309-311 from 1.1 git-svn-id: http://svn.dwoo.org/trunk@312 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d3270dde07b435b6b70091607a62ca4343fa1070
at Wednesday 4 November 2009 15:49:10 UTC removing executable flag from non-executable files git-svn-id: svn://dwoo.org/dwoo/trunk@307 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ef7c832153c4bbe4389845b5f6cb8d5c181622bc
at Sunday 18 October 2009 19:28:25 UTC Fixed a Dwoo_Data bug in the append method when the index didn't exist yet it threw a notice git-svn-id: svn://dwoo.org/dwoo/trunk@305 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cf39726d1f4bb2ee9ec5c56646e95bdf508aaaf8
at Sunday 18 October 2009 12:04:48 UTC Fixed an {extends} parsing bug that prevented the use of single-quotes around the parent template's filename fixes #39 git-svn-id: svn://dwoo.org/dwoo/trunk@301 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f4ab703d6d7598eecfb250b85fbe792bbf517cf5
at Sunday 18 October 2009 11:35:01 UTC adds support for {tif $var} alone, which acts like {optional} git-svn-id: svn://dwoo.org/dwoo/trunk@299 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c9eda80d191152594c2fc181880c1f062da3b690
at Monday 12 October 2009 21:18:54 UTC Fixed a bug when accessing global vars from a sub-template fixes #42 git-svn-id: svn://dwoo.org/dwoo/trunk@292 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f1766640aacd4ddcae46c189b35f976c6431502c
at Monday 12 October 2009 20:56:15 UTC Fixed a property reading bug on objects that implemented __get but not __isset, implementing __isset is however very much recommended fixes #36 git-svn-id: svn://dwoo.org/dwoo/trunk@290 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e756cf9ff13c42ffc12ebe7e626fcfc80547713e
at Monday 12 October 2009 20:00:24 UTC Fixed a bug when using the autoEscape feature with sub-templates (the compiled sub-template couldn't access the dwoo charset property, resulting in a fatal error) fixes #38 git-svn-id: svn://dwoo.org/dwoo/trunk@288 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c137b21c44c89ed39ea18d4fe38e517b15b0392b
at Wednesday 19 August 2009 03:51:08 UTC Added handling of a special case when callback is array(object, string) in case of an error of an undefined or non-optional parameter git-svn-id: svn://dwoo.org/dwoo/trunk@280 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion bd9d98a2da31aa33ed483ce6a263641430694680
at Wednesday 29 July 2009 19:44:45 UTC merging changes from 1.1 git-svn-id: svn://dwoo.org/dwoo/trunk@279 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d9572ef45a54a5adf5d88798813543e2e0a88333
at Saturday 18 July 2009 18:59:26 UTC Prep release 1.1.0 git-svn-id: svn://dwoo.org/dwoo/trunk@272 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ef0858b2a86453fb34daa3ac5b5c473ed9fd9a3c
at Wednesday 8 July 2009 23:30:44 UTC Fixes sub-templates issues when running through the same template/loading subtemplates multiple times git-svn-id: svn://dwoo.org/dwoo/trunk@270 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ce2fb905779a1b18830802cfdf759cf295dcaa4f
at Wednesday 8 July 2009 22:57:01 UTC No more double-slashes in template paths since this seemed to cause slight performance issues git-svn-id: svn://dwoo.org/dwoo/trunk@268 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dd288f0c2305785a5ffd92d0ff02e394b35a5222
at Wednesday 8 July 2009 21:42:52 UTC The include_path isn't altered anymore, hopefully saving some stat calls git-svn-id: svn://dwoo.org/dwoo/trunk@267 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e0b9baf8732bb37b50571adc7a9384a9126670f5
at Monday 29 June 2009 23:51:21 UTC updating dwoo compiled git-svn-id: svn://dwoo.org/dwoo/trunk@265 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ddea0cecf873c9dd2b2bf93d58d9d66d4baef55b
at Monday 29 June 2009 23:23:34 UTC fixes #6 Slight performance improvement with big inheritance trees git-svn-id: svn://dwoo.org/dwoo/trunk@263 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f01967476b86a9bc1ef073978dc996a78f337600
at Monday 29 June 2009 20:27:29 UTC For can now iterate backwards if you input numbers, it won't work with variables though git-svn-id: svn://dwoo.org/dwoo/trunk@262 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f71d428973ce672991ea54b7b889f17bad4821aa
at Friday 13 March 2009 10:14:51 UTC fixes #28 Fixed parsing of comments that were on top of the file when there are spaces at the end of it git-svn-id: svn://dwoo.org/dwoo/trunk@258 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d70fef110292658358385b0d7713d81b4bbb500d
at Wednesday 11 March 2009 10:33:37 UTC Fixes #2 - Updated Codeigniter adapter added Includes the bugfix for the problem as mentioned in the forums (http://forum.dwoo.org/viewtopic.php?pid=517#p517) git-svn-id: svn://dwoo.org/dwoo/trunk@255 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d630b126697582af188050bbf12d2657465b71da
at Tuesday 24 February 2009 20:21:37 UTC Added magic __call() method to allow more friendly calls from <?php ?> block in the templates git-svn-id: svn://dwoo.org/dwoo/trunk@253 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cd640a2bc75d534e8c1d9891546be55de3198336
at Saturday 7 February 2009 13:37:45 UTC Fixes #17 - thanks to Andreas de Pretis for the patch git-svn-id: svn://dwoo.org/dwoo/trunk@248 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion bd3508448973ce57d7025c12451aadd65324f498
at Thursday 5 February 2009 15:34:07 UTC really fixes #18 hopefully git-svn-id: svn://dwoo.org/dwoo/trunk@245 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion bb9b418ede26089f19699385d145c7ed7ef82ec5
at Thursday 22 January 2009 12:56:34 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@241 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ea8e8d54b56a861d535da96ba74077b875a6ee86
at Wednesday 21 January 2009 11:51:54 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@238 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e55d5ef43e1960d06bb45be6184d49c0f1ab57d5
at Sunday 11 January 2009 11:21:46 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@235 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e82c2f8ba77b21a1cd8a01a618ade0b36698ad50
at Saturday 10 January 2009 20:28:28 UTC Fixes parameter parsing when calling sub-templates with named parameters git-svn-id: svn://dwoo.org/dwoo/trunk@232 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dd2caf814427a758bce61ab96a3a51dd05d59e81
at Tuesday 16 December 2008 12:58:39 UTC Fixes wrong arg order when using cycle with assign git-svn-id: svn://dwoo.org/dwoo/trunk@222 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion eeffba503c21363da5268474ffa92a45574fd688
at Tuesday 28 October 2008 06:53:43 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@214 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e9bbec692166869450d982001c2dbcd6d9b1fab7
at Friday 24 October 2008 18:54:34 UTC * SmartyCompat: Fixed a few bugs in the adapter and processor - thanks to Stefan Moonen for the patches git-svn-id: svn://dwoo.org/dwoo/trunk@210 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f1d2e1da70301cf8014db7ed3ad743c59ce6e359
at Tuesday 14 October 2008 09:58:04 UTC * Changes params parsing in ZF adapter git-svn-id: svn://dwoo.org/dwoo/trunk@202 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion be3fb1b87e7b168128351a73b8f777d5cf2e59e2
at Thursday 9 October 2008 12:48:30 UTC * Fix in comment stripping git-svn-id: svn://dwoo.org/dwoo/trunk@200 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion b9d663a3abdf6baf46f7bcc58bed81c1ef007bbc
at Wednesday 8 October 2008 06:36:19 UTC * ZendFramework: major overhaul thanks to Denis Arh, templates files should probably be moved in the scripts subfolder after this update though git-svn-id: svn://dwoo.org/dwoo/trunk@194 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e1d4ca2464d5583a5b7aaee80dc1bc6ff248d7b2
at Friday 26 September 2008 20:12:28 UTC * Fixed parsing bug in {func()->propertyOfReturnedObject} git-svn-id: svn://dwoo.org/dwoo/trunk@190 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f20cfc38931ce96f8f40c3a1fcd4991a13f17e87
at Friday 26 September 2008 18:34:52 UTC spaces / tabs issues git-svn-id: svn://dwoo.org/dwoo/trunk@186 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d3c7dbd73547bd9ef10095325d11feecf3dbe93b
at Tuesday 16 September 2008 22:26:31 UTC * Plugins: improved the dump plugin, it now displays object's properties and optionally public methods (if the new show_methods arg is set to true) (thanks to Stephan Wentz for the patch) git-svn-id: svn://dwoo.org/dwoo/trunk@183 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f49e8f366eb7c64297db3ac612ec1a2a61fa9391
at Sunday 14 September 2008 22:45:59 UTC Fixed a 1.0.0beta regression that messed with custom plugin directories on Windows git-svn-id: svn://dwoo.org/dwoo/trunk@180 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ceaf53f589ad0732bacfb373139c5f29e0d78f6a
at Thursday 11 September 2008 19:49:27 UTC Added parameters to provide a custom engine (extends Dwoo) or a custom data class (extends Dwoo_Data) in the ZendFramework adapter (thanks V0r_X for the patch) git-svn-id: svn://dwoo.org/dwoo/trunk@177 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c266d49f474211056e29ae5925130ae7bf1bb638
at Monday 8 September 2008 10:12:22 UTC Updates compiled runtime git-svn-id: svn://dwoo.org/dwoo/trunk@175 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion eeef80e6dfc9d1783b2e56bc98ed4be242949667
at Monday 8 September 2008 09:12:42 UTC * fixes Agavi adapter's plugin_dir parameter handling git-svn-id: svn://dwoo.org/dwoo/trunk@173 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion bd14bd1c65291901840594debadeb7da25f7b02f
at Sunday 7 September 2008 22:09:18 UTC + Plugins: Added a mode parameter to {strip} to allow stripping of javascript code blocks that use "// comments", because without this special mode the comments result in syntax errors git-svn-id: svn://dwoo.org/dwoo/trunk@171 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dc37bfb6ce9c7d580fc9de49a945eae850a3e523
at Sunday 7 September 2008 21:55:11 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@168 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f738fcabc918594718b3dd2e4f79b9a91262cee0
at Wednesday 20 August 2008 07:05:23 UTC * Small bug fix for smarty function handling with no parameters git-svn-id: svn://dwoo.org/dwoo/trunk@149 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d9c6d6b9e9081c668f0267e19863ab9340244885
at Sunday 3 August 2008 13:02:26 UTC Prep release 0.9.3 git-svn-id: svn://dwoo.org/dwoo/trunk@140 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cacec94bac0ba8621b14332de00d5a5f464c39a6
at Wednesday 30 July 2008 16:57:36 UTC * Fixes {foo()->Bar} git-svn-id: svn://dwoo.org/dwoo/trunk@135 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e01426a6880f0b0426859af8ad517ab994d6ca2f
at Sunday 27 July 2008 21:29:09 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@129 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e8c6ecdcda43bdc7cf5d80537d4609dd0005e6da
at Sunday 27 July 2008 21:28:15 UTC + Added support for method calls into method calls parameters git-svn-id: svn://dwoo.org/dwoo/trunk@128 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e3eb1b763f123bdfd831342381e8ac971e1c7c97
at Friday 11 July 2008 06:16:47 UTC + Syntax: Static methods can be called using {Class::method()} git-svn-id: svn://dwoo.org/dwoo/trunk@122 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c2680477f2c8b21a746bbfe42fbfafabf401c0f5
at Tuesday 1 July 2008 22:30:03 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@119 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cb91f7d072dfe105347d1c5a763abf838e3b626a
at Friday 27 June 2008 19:31:26 UTC * Small compiler fix * Updated compiled version git-svn-id: svn://dwoo.org/dwoo/trunk@101 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion c6133a3e9e5e64ff5a894aa9bc662932663453e5
at Friday 27 June 2008 04:14:48 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@100 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f24d504dd80e4ec09971c5dbaf51328cc1733f01
at Thursday 19 June 2008 01:01:17 UTC + Added magic object-access methods to Dwoo_Data, so you can assign values by doing $data->var = $val; instead of $data->assign('var', $val); + Added get()/unassign()/isAssigned() methods to read, remove and check for the presence of a var inside a Dwoo_Data object git-svn-id: svn://dwoo.org/dwoo/trunk@98 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion d0cce28f5c75c33d462b4e4a2ba14a1b5b148e3e
at Monday 16 June 2008 23:15:49 UTC * Made the dependency on hash ext optional, although using it offers better perfs with Template_String git-svn-id: svn://dwoo.org/dwoo/trunk@97 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion b9a093a220449469d28f8aefe8cd3b88ba0b61e1
at Friday 6 June 2008 18:35:45 UTC * Plugins: added a fourth 'bool $case_sensitive' parameter to {replace} git-svn-id: svn://dwoo.org/dwoo/trunk@87 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f1a18407dd24991270a84194d8ac0738785639f7
at Friday 6 June 2008 14:41:37 UTC * Fixed compiler bug that prevented empty() to be called * Removed checks for methods/properties being present on objects before calling them since these can be handled by __get() and __call() => http://forum.dwoo.org/viewtopic.php?id=22 * Calling {func (params)} (with the space between function and params) is now allowed => http://forum.dwoo.org/viewtopic.php?id=21 git-svn-id: svn://dwoo.org/dwoo/trunk@86 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f860ba057249274885880d2bb6f0984c2e838ce0
at Friday 30 May 2008 22:37:07 UTC * PEAR CS changes git-svn-id: svn://dwoo.org/dwoo/trunk@81 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e1e75fed3a96612070e8f687a8e21544d6dedbaf
at Friday 30 May 2008 16:34:09 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@79 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dbcd8cb6970336d9e6f1975ea91356389ccd8861
at Friday 30 May 2008 02:42:25 UTC Prep release 0.9.1 git-svn-id: svn://dwoo.org/dwoo/trunk@75 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion da2f8fa1cd6cb2caa379cd0dcf847bb0355547a2
at Thursday 29 May 2008 00:54:23 UTC * Auto-escape now checks the var type before doing it's deed to prevent messing up with arrays git-svn-id: svn://dwoo.org/dwoo/trunk@71 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ea6d45d5954a22094bac93cc51224692f1634715
at Wednesday 28 May 2008 12:18:43 UTC * Added is_writable checks when changing the cache or compile directories * Finished commenting plugins git-svn-id: svn://dwoo.org/dwoo/trunk@70 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f377fd89fe5129c6f2f0e74173d6275c927aeb31
at Saturday 17 May 2008 01:48:25 UTC * {literal} and {strip} now follow the LooseOpeningsHandling setting git-svn-id: svn://dwoo.org/dwoo/trunk@64 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cfb65a97e88c53e1e2c3c3f5cd70ae9b01856b08
at Friday 16 May 2008 17:43:41 UTC * Fixed a bug in {date_format} that prevented anything but unix timestamps to work git-svn-id: svn://dwoo.org/dwoo/trunk@62 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f9cc66d330517c6ebf5d0c735321fa91bce50ec3
at Thursday 8 May 2008 21:40:48 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@51 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dc02338d7d58be9846639b7444ab78bf0d97c125
at Thursday 8 May 2008 14:53:05 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@50 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion f9676b0d0733c80ae218203a4303cc30cfeba6f4
at Thursday 8 May 2008 14:30:52 UTC + Added {$_key} var inside {loop} representing the current array key + Added new shortcuts : $ for current scope, $_ for $_parent and $__ for $_root + Added a 'data' argument to {include} to be able to feed data directly into it git-svn-id: svn://dwoo.org/dwoo/trunk@49 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion eec2dabe97d2ea38547ec46ffb70e1a0f9586ca5
at Tuesday 6 May 2008 08:48:16 UTC * Removed realpath() calls git-svn-id: svn://dwoo.org/dwoo/trunk@47 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion ecad8099cf66a53de2d1cd603d3e94f030935d64
at Tuesday 6 May 2008 07:10:45 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@45 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion daf0a0149cd4e669978b975f5d69fb78dc5acb78
at Monday 5 May 2008 19:01:01 UTC git-svn-id: svn://dwoo.org/dwoo/trunk@42 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion cc6c72f5f11ad1b67c932966f93e0acf799b76e3
at Monday 5 May 2008 18:50:52 UTC * Removed php closing tags at the end of files git-svn-id: svn://dwoo.org/dwoo/trunk@41 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion dc33f4178b7bce94be39b4d0e64766e8939d8df6
at Monday 28 April 2008 16:03:16 UTC ! Intermediate commit, unstable state * Changed all line endings (unix) and uniformized tabs/spaces to full tabs (tabspace 4) * Changed Dwoo::getCurrentTemplate() to Dwoo::getTemplate() and Dwoo::getTemplate() to Dwoo::templateFactory() * Small changes in the compiler git-svn-id: svn://dwoo.org/dwoo/trunk@30 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion eae99dc026e84efcc7f491b14efb87130804a5e4
at Saturday 5 April 2008 09:31:06 UTC * Fixes test bug git-svn-id: svn://dwoo.org/dwoo/trunk@12 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion efacbb5e69d59b8046f5a73eb56f1aae51e5b5c3
at Saturday 5 April 2008 05:52:36 UTC * Small error reporting fix in the compiler git-svn-id: svn://dwoo.org/dwoo/trunk@9 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion bfa5635a05066d65270be703ee5354a7cded7566
at Saturday 5 April 2008 05:36:28 UTC ! BC Break: DWOO_PATH changed to DWOO_DIR + Added the DwooException class + Added DWOO_CACHEDIR and DWOO_COMPILEDIR constants that you can set before including Dwoo.php to override the defaults (although Dwoo->setCacheDir/setCompileDir() still work to change that if required) * Made all the error triggering more consistent git-svn-id: svn://dwoo.org/dwoo/trunk@8 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e25e1870d379942bb602b67832cd15b69fcedcc4
at Sunday 30 March 2008 12:10:13 UTC + Syntax: Added support for method calls on objects i.e. {$foo->bar()} + Added support for smarty security features, see the DwooSecurityPolicy class and $dwoo->setSecurityPolicy() + API: Added a DwooCompiler->setLooseOpeningHandling() method that, if set to true, allows tags to * Fixed {elseif} bug that appeared when multiple elseif tags were used in a row * Syntax: Improved simple math support to work within variable variables (i.e. you can do {$array[$index+1]}) and within strings as well. To prevent this enclose the variables in backticks (i.e. {"$foo/$bar"} will do the math while {"`$foo`/$bar"} won't as $foo is properly delimited) git-svn-id: svn://dwoo.org/dwoo/trunk@4 0598d79b-80c4-4d41-97ba-ac86fbbd088bVersion e31da1c6cd4857ac1efc5a7d9d103d6358810dd9
at Sunday 30 March 2008 01:23:53 UTC First Import / 0.3.3 git-svn-id: svn://dwoo.org/dwoo/trunk@2 0598d79b-80c4-4d41-97ba-ac86fbbd088bDiff
| b8ab7d | f9e789 | a/CHANGELOG |
|---|---|---|
| 30 | 30 | to use them even as string. |
| 31 | 31 | * Fixed parsing bug with method calls used as arguments with a comma |
| 32 | 32 | following. |
| 33 | +* Fixed parsing of function/constants that start with an underscore, | |
| 34 | + thanks to Dominik del Bondio for the patch | |
| 33 | 35 | |
| 34 | 36 | [2010-02-07] 1.1.1 |
| 35 | 37 | + Added {optional} plugin that just prints an optional var without any |
| 538 | 540 | although the API to register them is already in. |
| 539 | 541 | |
| 540 | 542 | [2008-02-08] 0.1.0 |
| 541 | -Initial release | |
| 543 | +Initial release | |
| b8ab7d | f9e789 | a/lib/Dwoo/Compiler.php |
| 1355 | 1355 | // var |
| 1356 | 1356 | $out = $this->parseVar($in, $from, $to, $parsingParams, $curBlock, $pointer); |
| 1357 | 1357 | $parsed = 'var'; |
| 1358 | - } elseif ($first==='%' && preg_match('#^%[a-z]#i', $substr)) { | |
| 1358 | + } elseif ($first==='%' && preg_match('#^%[a-z_]#i', $substr)) { | |
| 1359 | 1359 | // const |
| 1360 | 1360 | $out = $this->parseConst($in, $from, $to, $parsingParams, $curBlock, $pointer); |
| 1361 | 1361 | } elseif (($first==='"' || $first==="'") && !(is_array($parsingParams) && preg_match('#^([\'"])[a-z0-9_]+\1\s*=>?(?:\s+|[^=])#i', $substr))) { |
| 1362 | 1362 | // string |
| 1363 | 1363 | $out = $this->parseString($in, $from, $to, $parsingParams, $curBlock, $pointer); |
| 1364 | - } elseif (preg_match('/^[a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?('.(is_array($parsingParams)||$curBlock!='root'?'':'\s+[^(]|').'\s*\(|\s*'.$this->rdr.'|\s*;)/i', $substr)) { | |
| 1364 | + } elseif (preg_match('/^[a-z_][a-z0-9_]*(?:::[a-z_][a-z0-9_]*)?('.(is_array($parsingParams)||$curBlock!='root'?'':'\s+[^(]|').'\s*\(|\s*'.$this->rdr.'|\s*;)/i', $substr)) { | |
| 1365 | 1365 | // func |
| 1366 | 1366 | $out = $this->parseFunction($in, $from, $to, $parsingParams, $curBlock, $pointer); |
| 1367 | 1367 | $parsed = 'func'; |
| 1372 | 1372 | $pointer++; |
| 1373 | 1373 | } |
| 1374 | 1374 | return $this->parse($in, $from+1, $to, false, 'root', $pointer); |
| 1375 | - } elseif ($curBlock === 'root' && preg_match('#^/([a-z][a-z0-9_]*)?#i', $substr, $match)) { | |
| 1375 | + } elseif ($curBlock === 'root' && preg_match('#^/([a-z_][a-z0-9_]*)?#i', $substr, $match)) { | |
| 1376 | 1376 | // close block |
| 1377 | 1377 | if (!empty($match[1]) && $match[1] == 'else') { |
| 1378 | 1378 | throw new Dwoo_Compilation_Exception($this, 'Else blocks must not be closed explicitly, they are automatically closed when their parent block is closed'); |
| 1537 | 1537 | } |
| 1538 | 1538 | |
| 1539 | 1539 | // func parsed, check if any func-extension applies |
| 1540 | - if ($parsed==='func' && preg_match('#^->[a-z0-9_]+(\s*\(.+|->[a-z].*)?#is', $substr, $match)) { | |
| 1540 | + if ($parsed==='func' && preg_match('#^->[a-z0-9_]+(\s*\(.+|->[a-z_].*)?#is', $substr, $match)) { | |
| 1541 | 1541 | // parse method call or property read |
| 1542 | 1542 | $ptr = 0; |
| 1543 | 1543 | |
| 1574 | 1574 | protected function parseFunction($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) |
| 1575 | 1575 | { |
| 1576 | 1576 | $cmdstr = substr($in, $from, $to-$from); |
| 1577 | - preg_match('/^([a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?)(\s*'.$this->rdr.'|\s*;)?/i', $cmdstr, $match); | |
| 1577 | + preg_match('/^([a-z_][a-z0-9_]*(?:::[a-z_][a-z0-9_]*)?)(\s*'.$this->rdr.'|\s*;)?/i', $cmdstr, $match); | |
| 1578 | 1578 | |
| 1579 | 1579 | if (empty($match[1])) { |
| 1580 | 1580 | throw new Dwoo_Compilation_Exception($this, 'Parse error, invalid function name : '.substr($cmdstr, 0, 15)); |
| 2688 | 2688 | } |
| 2689 | 2689 | $cmdstr = $cmdstrsrc; |
| 2690 | 2690 | $paramsep = ':'; |
| 2691 | - if (!preg_match('/^(@{0,2}[a-z][a-z0-9_]*)(:)?/i', $cmdstr, $match)) { | |
| 2691 | + if (!preg_match('/^(@{0,2}[a-z_][a-z0-9_]*)(:)?/i', $cmdstr, $match)) { | |
| 2692 | 2692 | throw new Dwoo_Compilation_Exception($this, 'Invalid modifier name, started with : '.substr($cmdstr, 0, 10)); |
| 2693 | 2693 | } |
| 2694 | 2694 | $paramspos = !empty($match[2]) ? strlen($match[1]) : false; |
| b8ab7d | f9e789 | a/tests/CompilerTests.php |
| 318 | 318 | |
| 319 | 319 | public function testMethodCalls() |
| 320 | 320 | { |
| 321 | - $tpl = new Dwoo_Template_String('{$a} {$a->foo()} {$b[$c]->foo()} {$a->bar()+$a->bar()} {$a->baz(5, $foo)} {$a->make(5)->getInt()} {$a->make(5)->getInt()/2}'); | |
| 321 | + $tpl = new Dwoo_Template_String('{$a} {$a->foo()} {$b[$c]->foo()} {$a->bar()+$a->bar()} {$a->baz(5, $foo)} {$a->make(5)->getInt()} {$a->make(5)->getInt()/2} {$a->_foo($foo, 5)} {$a->_fooChain()->_foo(5, $foo)}'); | |
| 322 | 322 | $tpl->forceCompilation(); |
| 323 | 323 | |
| 324 | 324 | $a = new MethodCallsHelper(); |
| 325 | - $this->assertEquals('obj 0 1 7 10bar 5 2.5', $this->dwoo->get($tpl, array('a'=>$a, 'b'=>array('test'=>$a), 'c'=>'test', 'foo'=>'bar'), $this->compiler)); | |
| 325 | + $this->assertEquals('obj 0 1 7 10bar 5 2.5 -5bar- -bar5-', $this->dwoo->get($tpl, array('a'=>$a, 'b'=>array('test'=>$a), 'c'=>'test', 'foo'=>'bar'), $this->compiler)); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | public function testLooseTagHandling() |
| 712 | 712 | $tpl->forceCompilation(); |
| 713 | 713 | $this->assertEquals('testtest', $this->dwoo->get($tpl, array('obj'=>new PluginHelper()), $this->compiler)); |
| 714 | 714 | } |
| 715 | + | |
| 716 | + public function testFunctionCanStartWithUnderscore() | |
| 717 | + { | |
| 718 | + $tpl = new Dwoo_Template_String('{_underscoreHelper("test", _underscoreHelper("bar", 10))|_underscoreModifierHelper}'); | |
| 719 | + $tpl->forceCompilation(); | |
| 720 | + $this->assertEquals('_--10bar-test-_', $this->dwoo->get($tpl, array(), $this->compiler)); | |
| 721 | + } | |
| 722 | + | |
| 715 | 723 | } |
| 716 | 724 | |
| 717 | 725 | function excessArgsHelper($a) { |
| 719 | 727 | return implode(':', $args); |
| 720 | 728 | } |
| 721 | 729 | |
| 730 | +function _underscoreHelper($foo, $bar) { | |
| 731 | + return "-$bar$foo-"; | |
| 732 | +} | |
| 733 | + | |
| 734 | +function _underscoreModifierHelper($value) { | |
| 735 | + return "_${value}_"; | |
| 736 | +} | |
| 737 | + | |
| 722 | 738 | class StaticHelper { |
| 723 | 739 | static $foo = 33; |
| 724 | 740 | } |
| 822 | 838 | public static function staticFoo($bar, $baz) { |
| 823 | 839 | return "-$baz$bar-"; |
| 824 | 840 | } |
| 841 | + | |
| 842 | + public function _foo($bar, $baz) { | |
| 843 | + return "-$baz$bar-"; | |
| 844 | + } | |
| 845 | + | |
| 846 | + public function _fooChain() { | |
| 847 | + return $this; | |
| 848 | + } | |
| 825 | 849 | } |