Commit 40bd3808 by Seldaek

git-svn-id: svn://dwoo.org/dwoo/trunk@106 0598d79b-80c4-4d41-97ba-ac86fbbd088b

parent 66070b49
[2008--] 0.9.2 [2008-06-28] 0.9.2
! BC Break: Renamed the {strip} modifier/function to {whitespace}, this does ! BC Break: Renamed the {strip} modifier/function to {whitespace}, this does
not affect the strip block, that has been moved off the compiler into a not affect the strip block, that has been moved off the compiler into a
plugin. Which is why the name conflict had to be resolved plugin. Which is why the name conflict had to be resolved. Please report
any issue you might encounter when using the strip block
! BC Break: Changed the function signature of Dwoo_Block_Plugin::postProcessing ! BC Break: Changed the function signature of Dwoo_Block_Plugin::postProcessing
it only affects you if you had any custom block plugins, see UPGRADE_NOTES it only affects you if you had any custom block plugins, see UPGRADE_NOTES
for more details for more details
! BC Break: Dwoo_ITemplate::cache() must now return the cached file name or false if ! BC Break: Dwoo_ITemplate::cache() must now return the cached file name or false if
caching failed, only affects you if you had a custom template class and caching failed, only affects you if you had a custom template class and
implemented cache() yourself implemented cache() yourself
! BC Break: Dwoo_Loader is not static anymore so anything you did on it directly ! BC Break: Dwoo_Loader is not static anymore so anything you did on it directly
will break. Use $dwoo->getLoader()->addDirectory() instead of will break. Use $dwoo->getLoader()->addDirectory() instead of
Dwoo_Loader::addDirectory() for example Dwoo_Loader::addDirectory() for example
! BC Break: DWOO_COMPILE_DIRECTORY and DWOO_CACHE_DIRECTORY are gone, set those ! BC Break: DWOO_COMPILE_DIRECTORY and DWOO_CACHE_DIRECTORY are gone, set those
paths in Dwoo's constructor (i.e. new Dwoo('compiledir', 'cachedir')) if you paths in Dwoo's constructor (i.e. new Dwoo('compiledir', 'cachedir')) if you
need to override the default ones need to override the default ones
+ Plugins: Added {dynamic} that allows cached templates to have dynamic + Plugins: Added {dynamic} that allows cached templates to have dynamic
(non-cached) parts, when rendering a cached page, the dynamic parts can still (non-cached) parts, when rendering a cached page, the dynamic parts can still
use the variables you provides use the variables you provides
+ Plugins: Added {tif} that acts as a ternary if / allows you to use a ternary + Plugins: Added {tif} that acts as a ternary if / allows you to use a ternary
...@@ -24,17 +25,17 @@ ...@@ -24,17 +25,17 @@
+ Added line numbers in compilation errors and improved several error messages + Added line numbers in compilation errors and improved several error messages
+ Added magic object-access methods to Dwoo_Data, so you can assign values by + Added magic object-access methods to Dwoo_Data, so you can assign values by
doing $data->var = $val; instead of $data->assign('var', $val); doing $data->var = $val; instead of $data->assign('var', $val);
+ Added get()/unassign()/isAssigned() methods to read, remove and check for the + Added get()/unassign()/isAssigned() methods to read, remove and check for the
presence of a var inside a Dwoo_Data object presence of a var inside a Dwoo_Data object
* Plugins: added a fifth 'string $implode' parameter to {foreach}, it prints * Plugins: added a fifth 'string $implode' parameter to {foreach}, it prints
whatever you provide it between each item of the foreach, just like implode() whatever you provide it between each item of the foreach, just like implode()
* Plugins: added a fourth 'bool $case_sensitive' parameter to {replace} * Plugins: added a fourth 'bool $case_sensitive' parameter to {replace}
* Plugins: added a fourth 'bool $trim' parameter to {capture} that trims * Plugins: added a fourth 'bool $trim' parameter to {capture} that trims
the captured text the captured text
* Made the dependency on the hash extension optional * Made the dependency on the hash extension optional
* Fixed compiler bug that prevented method calls combined with named parameters * Fixed compiler bug that prevented method calls combined with named parameters
* Fixed compiler bug that prevented the % shortcut for constants to work within * Fixed compiler bug that prevented the % shortcut for constants to work within
function calls (basically it only worked as {%CONST}) function calls (basically it only worked as {%CONST})
* Fixed compiler bug that prevented empty() to be called * Fixed compiler bug that prevented empty() to be called
* Fixed several modifier parsing bugs * Fixed several modifier parsing bugs
=> http://forum.dwoo.org/viewtopic.php?id=27 => http://forum.dwoo.org/viewtopic.php?id=27
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- 0.9.2 -- 0.9.2
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
1. Block plugins 1. Block plugins
----------------- -----------------
This version introduced a backward compatibility break with block plugins, this This version introduced a backward compatibility break with block plugins, this
...@@ -11,17 +11,17 @@ very careful if you manipulate this content since it is php code and should rema ...@@ -11,17 +11,17 @@ very careful if you manipulate this content since it is php code and should rema
so if you don't want syntax errors (which are fatal) during template run. so if you don't want syntax errors (which are fatal) during template run.
Error message : Error message :
Strict Standards: Declaration of Dwoo_Plugin_*::postProcessing() should be compatible with that of Dwoo_Block_Plugin::postProcessing() Strict Standards: Declaration of Dwoo_Plugin_*::postProcessing() should be compatible with that of Dwoo_Block_Plugin::postProcessing()
Solution : Solution :
* Change your block plugins postProcessing method declaration to the following : * Change your block plugins postProcessing method declaration to the following :
public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
* Then add "$content" to the beginning of your return value, or modify it if required * Then add "$content" to the beginning of your return value, or modify it if required
2. Strip modifier 2. Strip modifier
----------------- -----------------
...@@ -29,4 +29,12 @@ The strip modifier had the same name as the strip block, this worked when the bl ...@@ -29,4 +29,12 @@ The strip modifier had the same name as the strip block, this worked when the bl
was hard coded within the compiler, but with the API change (see above) I was able was hard coded within the compiler, but with the API change (see above) I was able
to move it to a plugin. Since both plugins don't have the same purpose, there was to move it to a plugin. Since both plugins don't have the same purpose, there was
a real problem and I had to rename it. The renaming will be handled by the smarty compatibility a real problem and I had to rename it. The renaming will be handled by the smarty compatibility
layer, but if you used it without smarty compatibility, you should edit your templates. layer, but if you used it without smarty compatibility, you should edit your templates.
\ No newline at end of file
3. DWOO_COMPILE_DIRECTORY and DWOO_CACHE_DIRECTORY constants
------------------------------------------------------------
If you used those before, you will now get an exception when loading Dwoo. This is done
on purpose to help people to make the transition to the new method of doing it :
$dwoo = new Dwoo('myCompileDir', 'myCacheDir');
\ No newline at end of file
...@@ -68,7 +68,7 @@ class Dwoo ...@@ -68,7 +68,7 @@ class Dwoo
* *
* @var string * @var string
*/ */
const VERSION = "0.9.1"; const VERSION = "0.9.2";
/** /**
* unique number of this dwoo release * unique number of this dwoo release
...@@ -77,7 +77,7 @@ class Dwoo ...@@ -77,7 +77,7 @@ class Dwoo
* has been compiled before this release or not, so that old templates are * has been compiled before this release or not, so that old templates are
* recompiled automatically when Dwoo is updated * recompiled automatically when Dwoo is updated
*/ */
const RELEASE_TAG = 10; const RELEASE_TAG = 11;
/**#@+ /**#@+
* constants that represents all plugin types * constants that represents all plugin types
...@@ -205,11 +205,11 @@ class Dwoo ...@@ -205,11 +205,11 @@ class Dwoo
/** /**
* the dwoo loader object used to load plugins by this dwoo instance * the dwoo loader object used to load plugins by this dwoo instance
* *
* @var Dwoo_ILoader * @var Dwoo_ILoader
*/ */
protected $loader = null; protected $loader = null;
/** /**
* currently rendered template, set to null when not-rendering * currently rendered template, set to null when not-rendering
* *
...@@ -268,7 +268,7 @@ class Dwoo ...@@ -268,7 +268,7 @@ class Dwoo
/** /**
* constructor, sets the cache and compile dir to the default values if not provided * constructor, sets the cache and compile dir to the default values if not provided
* *
* @param string $compileDir path to the compiled directory, defaults to lib/compiled * @param string $compileDir path to the compiled directory, defaults to lib/compiled
* @param string $cacheDir path to the cache directory, defaults to lib/cache * @param string $cacheDir path to the cache directory, defaults to lib/cache
*/ */
...@@ -347,7 +347,7 @@ class Dwoo ...@@ -347,7 +347,7 @@ class Dwoo
$_tpl = new Dwoo_Template_File($_tpl); $_tpl = new Dwoo_Template_File($_tpl);
} elseif (strstr($_tpl, ':')) { } elseif (strstr($_tpl, ':')) {
$_bits = explode(':', $_tpl, 2); $_bits = explode(':', $_tpl, 2);
$_tpl = $this->templateFactory($_bits[0], $_bits[1]); $_tpl = $this->templateFactory($_bits[0], $_bits[1]);
} else { } else {
$_tpl = new Dwoo_Template_String($_tpl); $_tpl = new Dwoo_Template_String($_tpl);
} }
...@@ -393,7 +393,7 @@ class Dwoo ...@@ -393,7 +393,7 @@ class Dwoo
if ($doCache === true) { if ($doCache === true) {
$dynamicId = uniqid(); $dynamicId = uniqid();
} }
// render template // render template
$out = include $_tpl->getCompiledTemplate($this, $_compiler); $out = include $_tpl->getCompiledTemplate($this, $_compiler);
...@@ -402,7 +402,7 @@ class Dwoo ...@@ -402,7 +402,7 @@ class Dwoo
$_tpl->forceCompilation(); $_tpl->forceCompilation();
$out = include $_tpl->getCompiledTemplate($this, $_compiler); $out = include $_tpl->getCompiledTemplate($this, $_compiler);
} }
if ($doCache === true) { if ($doCache === true) {
$out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php /*'.$dynamicId.'*/ echo \'$1\'; ?>', $out); $out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php /*'.$dynamicId.'*/ echo \'$1\'; ?>', $out);
if (!class_exists('Dwoo_plugin_dynamic', false)) { if (!class_exists('Dwoo_plugin_dynamic', false)) {
...@@ -410,7 +410,7 @@ class Dwoo ...@@ -410,7 +410,7 @@ class Dwoo
} }
$out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId); $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId);
} }
// process filters // process filters
foreach ($this->filters as $filter) { foreach ($this->filters as $filter) {
if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) {
...@@ -620,20 +620,20 @@ class Dwoo ...@@ -620,20 +620,20 @@ class Dwoo
/* /*
* --------- getters and setters --------- * --------- getters and setters ---------
*/ */
/** /**
* sets the loader object to use to load plugins * sets the loader object to use to load plugins
* *
* @param Dwoo_ILoader $loader loader object * @param Dwoo_ILoader $loader loader object
*/ */
public function setLoader(Dwoo_ILoader $loader) public function setLoader(Dwoo_ILoader $loader)
{ {
$this->loader = $loader; $this->loader = $loader;
} }
/** /**
* returns the current loader object or a default one if none is currently found * returns the current loader object or a default one if none is currently found
* *
* @param Dwoo_ILoader * @param Dwoo_ILoader
*/ */
public function getLoader() public function getLoader()
...@@ -641,7 +641,7 @@ class Dwoo ...@@ -641,7 +641,7 @@ class Dwoo
if ($this->loader === null) { if ($this->loader === null) {
$this->loader = new Dwoo_Loader($this->compileDir); $this->loader = new Dwoo_Loader($this->compileDir);
} }
return $this->loader; return $this->loader;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment