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
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
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
! 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
! 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
implemented cache() yourself
! 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
! 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
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
use the variables you provides
+ Plugins: Added {tif} that acts as a ternary if / allows you to use a ternary
......@@ -24,17 +25,17 @@
+ 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
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
* Plugins: added a fifth 'string $implode' parameter to {foreach}, it prints
whatever you provide it between each item of the foreach, just like implode()
* Plugins: added a fifth 'string $implode' parameter to {foreach}, it prints
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 $trim' parameter to {capture} that trims
the captured text
* Made the dependency on the hash extension optional
* Fixed compiler bug that prevented method calls combined with named parameters
* 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 several modifier parsing bugs
=> http://forum.dwoo.org/viewtopic.php?id=27
......
......@@ -2,7 +2,7 @@
-- 0.9.2
-----------------------------------------------------------------------------
1. Block plugins
1. Block plugins
-----------------
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
so if you don't want syntax errors (which are fatal) during template run.
Error message :
Strict Standards: Declaration of Dwoo_Plugin_*::postProcessing() should be compatible with that of Dwoo_Block_Plugin::postProcessing()
Solution :
* Change your block plugins postProcessing method declaration to the following :
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
-----------------
......@@ -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
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
layer, but if you used it without smarty compatibility, you should edit your templates.
\ No newline at end of file
layer, but if you used it without smarty compatibility, you should edit your templates.
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
*
* @var string
*/
const VERSION = "0.9.1";
const VERSION = "0.9.2";
/**
* unique number of this dwoo release
......@@ -77,7 +77,7 @@ class Dwoo
* has been compiled before this release or not, so that old templates are
* recompiled automatically when Dwoo is updated
*/
const RELEASE_TAG = 10;
const RELEASE_TAG = 11;
/**#@+
* constants that represents all plugin types
......@@ -205,11 +205,11 @@ class Dwoo
/**
* the dwoo loader object used to load plugins by this dwoo instance
*
*
* @var Dwoo_ILoader
*/
protected $loader = null;
/**
* currently rendered template, set to null when not-rendering
*
......@@ -268,7 +268,7 @@ class Dwoo
/**
* 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 $cacheDir path to the cache directory, defaults to lib/cache
*/
......@@ -347,7 +347,7 @@ class Dwoo
$_tpl = new Dwoo_Template_File($_tpl);
} elseif (strstr($_tpl, ':')) {
$_bits = explode(':', $_tpl, 2);
$_tpl = $this->templateFactory($_bits[0], $_bits[1]);
$_tpl = $this->templateFactory($_bits[0], $_bits[1]);
} else {
$_tpl = new Dwoo_Template_String($_tpl);
}
......@@ -393,7 +393,7 @@ class Dwoo
if ($doCache === true) {
$dynamicId = uniqid();
}
// render template
$out = include $_tpl->getCompiledTemplate($this, $_compiler);
......@@ -402,7 +402,7 @@ class Dwoo
$_tpl->forceCompilation();
$out = include $_tpl->getCompiledTemplate($this, $_compiler);
}
if ($doCache === true) {
$out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php /*'.$dynamicId.'*/ echo \'$1\'; ?>', $out);
if (!class_exists('Dwoo_plugin_dynamic', false)) {
......@@ -410,7 +410,7 @@ class Dwoo
}
$out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId);
}
// process filters
foreach ($this->filters as $filter) {
if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) {
......@@ -620,20 +620,20 @@ class Dwoo
/*
* --------- getters and setters ---------
*/
/**
* sets the loader object to use to load plugins
*
*
* @param Dwoo_ILoader $loader loader object
*/
public function setLoader(Dwoo_ILoader $loader)
public function setLoader(Dwoo_ILoader $loader)
{
$this->loader = $loader;
}
/**
* returns the current loader object or a default one if none is currently found
*
*
* @param Dwoo_ILoader
*/
public function getLoader()
......@@ -641,7 +641,7 @@ class Dwoo
if ($this->loader === null) {
$this->loader = new Dwoo_Loader($this->compileDir);
}
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