Arbit - project tracking

Dwoo

History

Diff

9aa351 2fd2c9 a/LICENSE
2 - GNU LESSER GENERAL PUBLIC LICENSE
3 - Version 3, 29 June 2007
4 -
5 - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
6 - Everyone is permitted to copy and distribute verbatim copies
7 - of this license document, but changing it is not allowed.
8 -
9 -
10 - This version of the GNU Lesser General Public License incorporates
11 -the terms and conditions of version 3 of the GNU General Public
12 -License, supplemented by the additional permissions listed below.
13 -
14 - 0. Additional Definitions.
15 -
16 - As used herein, "this License" refers to version 3 of the GNU Lesser
17 -General Public License, and the "GNU GPL" refers to version 3 of the GNU
18 -General Public License.
19 -
20 - "The Library" refers to a covered work governed by this License,
21 -other than an Application or a Combined Work as defined below.
22 -
23 - An "Application" is any work that makes use of an interface provided
24 -by the Library, but which is not otherwise based on the Library.
25 -Defining a subclass of a class defined by the Library is deemed a mode
26 -of using an interface provided by the Library.
27 -
28 - A "Combined Work" is a work produced by combining or linking an
29 -Application with the Library. The particular version of the Library
30 -with which the Combined Work was made is also called the "Linked
31 -Version".
32 -
33 - The "Minimal Corresponding Source" for a Combined Work means the
34 -Corresponding Source for the Combined Work, excluding any source code
35 -for portions of the Combined Work that, considered in isolation, are
36 -based on the Application, and not on the Linked Version.
37 -
38 - The "Corresponding Application Code" for a Combined Work means the
39 -object code and/or source code for the Application, including any data
40 -and utility programs needed for reproducing the Combined Work from the
41 -Application, but excluding the System Libraries of the Combined Work.
42 -
43 - 1. Exception to Section 3 of the GNU GPL.
44 -
45 - You may convey a covered work under sections 3 and 4 of this License
46 -without being bound by section 3 of the GNU GPL.
47 -
48 - 2. Conveying Modified Versions.
49 -
50 - If you modify a copy of the Library, and, in your modifications, a
51 -facility refers to a function or data to be supplied by an Application
52 -that uses the facility (other than as an argument passed when the
53 -facility is invoked), then you may convey a copy of the modified
54 -version:
55 -
56 - a) under this License, provided that you make a good faith effort to
57 - ensure that, in the event an Application does not supply the
58 - function or data, the facility still operates, and performs
59 - whatever part of its purpose remains meaningful, or
60 -
61 - b) under the GNU GPL, with none of the additional permissions of
62 - this License applicable to that copy.
63 -
64 - 3. Object Code Incorporating Material from Library Header Files.
65 -
66 - The object code form of an Application may incorporate material from
67 -a header file that is part of the Library. You may convey such object
68 -code under terms of your choice, provided that, if the incorporated
69 -material is not limited to numerical parameters, data structure
70 -layouts and accessors, or small macros, inline functions and templates
71 -(ten or fewer lines in length), you do both of the following:
72 -
73 - a) Give prominent notice with each copy of the object code that the
74 - Library is used in it and that the Library and its use are
75 - covered by this License.
76 -
77 - b) Accompany the object code with a copy of the GNU GPL and this license
78 - document.
79 -
80 - 4. Combined Works.
81 -
82 - You may convey a Combined Work under terms of your choice that,
83 -taken together, effectively do not restrict modification of the
84 -portions of the Library contained in the Combined Work and reverse
85 -engineering for debugging such modifications, if you also do each of
86 -the following:
87 -
88 - a) Give prominent notice with each copy of the Combined Work that
89 - the Library is used in it and that the Library and its use are
90 - covered by this License.
91 -
92 - b) Accompany the Combined Work with a copy of the GNU GPL and this license
93 - document.
94 -
95 - c) For a Combined Work that displays copyright notices during
96 - execution, include the copyright notice for the Library among
97 - these notices, as well as a reference directing the user to the
98 - copies of the GNU GPL and this license document.
99 -
100 - d) Do one of the following:
101 -
102 - 0) Convey the Minimal Corresponding Source under the terms of this
103 - License, and the Corresponding Application Code in a form
104 - suitable for, and under terms that permit, the user to
105 - recombine or relink the Application with a modified version of
106 - the Linked Version to produce a modified Combined Work, in the
107 - manner specified by section 6 of the GNU GPL for conveying
108 - Corresponding Source.
109 -
110 - 1) Use a suitable shared library mechanism for linking with the
111 - Library. A suitable mechanism is one that (a) uses at run time
112 - a copy of the Library already present on the user's computer
113 - system, and (b) will operate properly with a modified version
114 - of the Library that is interface-compatible with the Linked
115 - Version.
116 -
117 - e) Provide Installation Information, but only if you would otherwise
118 - be required to provide such information under section 6 of the
119 - GNU GPL, and only to the extent that such information is
120 - necessary to install and execute a modified version of the
121 - Combined Work produced by recombining or relinking the
122 - Application with a modified version of the Linked Version. (If
123 - you use option 4d0, the Installation Information must accompany
124 - the Minimal Corresponding Source and Corresponding Application
125 - Code. If you use option 4d1, you must provide the Installation
126 - Information in the manner specified by section 6 of the GNU GPL
127 - for conveying Corresponding Source.)
128 -
129 - 5. Combined Libraries.
130 -
131 - You may place library facilities that are a work based on the
132 -Library side by side in a single library together with other library
133 -facilities that are not Applications and are not covered by this
134 -License, and convey such a combined library under terms of your
135 -choice, if you do both of the following:
136 -
137 - a) Accompany the combined library with a copy of the same work based
138 - on the Library, uncombined with any other library facilities,
139 - conveyed under the terms of this License.
140 -
141 - b) Give prominent notice with the combined library that part of it
142 - is a work based on the Library, and explaining where to find the
143 - accompanying uncombined form of the same work.
144 -
145 - 6. Revised Versions of the GNU Lesser General Public License.
146 -
147 - The Free Software Foundation may publish revised and/or new versions
148 -of the GNU Lesser General Public License from time to time. Such new
149 -versions will be similar in spirit to the present version, but may
150 -differ in detail to address new problems or concerns.
151 -
152 - Each version is given a distinguishing version number. If the
153 -Library as you received it specifies that a certain numbered version
154 -of the GNU Lesser General Public License "or any later version"
155 -applies to it, you have the option of following the terms and
156 -conditions either of that published version or of any later version
157 -published by the Free Software Foundation. If the Library as you
158 -received it does not specify a version number of the GNU Lesser
159 -General Public License, you may choose any version of the GNU Lesser
160 -General Public License ever published by the Free Software Foundation.
161 -
162 - If the Library as you received it specifies that a proxy can decide
163 -whether future versions of the GNU Lesser General Public License shall
164 -apply, that proxy's public statement of acceptance of any version is
165 -permanent authorization for you to choose that version for the
166 -Library.
2 +Copyright (c) 2008, Dwoo / Jordi Boggiano
3 +All rights reserved.
4 +
5 +Redistribution and use in source and binary forms, with or without
6 +modification, are permitted provided that the following conditions are met:
7 +
8 + * Redistributions of source code must retain the above copyright
9 + notice, this list of conditions and the following disclaimer.
10 + * Redistributions in binary form must reproduce the above copyright
11 + notice, this list of conditions and the following disclaimer in the
12 + documentation and/or other materials provided with the distribution.
13 + * Neither the name of Dwoo nor the names of its contributors may be
14 + used to endorse or promote products derived from this software
15 + without specific prior written permission.
16 +
17 +THIS SOFTWARE IS PROVIDED BY JORDI BOGGIANO ''AS IS'' AND ANY
18 +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 +DISCLAIMED. IN NO EVENT SHALL JORDI BOGGIANO BE LIABLE FOR ANY
21 +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9aa351 2fd2c9 a/README
2 2 -----------------------------------------------------------------------------
3 --- WHAT IS DWOO? readme - version 0.9.0
3 +-- WHAT IS DWOO? readme - version 1.0.0
4 4 -----------------------------------------------------------------------------
5 5 Dwoo is a PHP5 Template Engine that was started in early 2008. The idea came
6 6 from the fact that Smarty, a well known template engine, is getting older and
24 24 -----------------------------------------------------------------------------
25 25 -- LICENSE
26 26 -----------------------------------------------------------------------------
27 -Dwoo is released under the GNU Lesser General Public License version 3.0.
27 +Dwoo is released under the Modified BSD license.
28 28 See the LICENSE file included in the archive or go to the URL below to obtain
29 29 a copy.
30 30
31 -http://www.gnu.org/licenses/lgpl.html
31 +http://dwoo.org/LICENSE
32 32
33 33 -----------------------------------------------------------------------------
34 34 -- QUICK START - RUNNING DWOO
9aa351 2fd2c9 a/lib/Dwoo.compiled.php
2 -<?php define('DWOO_DIRECTORY', dirname(__FILE__) . DIRECTORY_SEPARATOR); class Dwoo { const VERSION = "1.0.0beta"; const RELEASE_TAG = 13; const CLASS_PLUGIN = 1; const FUNC_PLUGIN = 2; const NATIVE_PLUGIN = 4; const BLOCK_PLUGIN = 8; const COMPILABLE_PLUGIN = 16; const CUSTOM_PLUGIN = 32; const SMARTY_MODIFIER = 64; const SMARTY_BLOCK = 128; const SMARTY_FUNCTION = 256; const PROXY_PLUGIN = 512; protected $charset = 'utf-8'; protected $globals; protected $compileDir; protected $cacheDir; protected $cacheTime = 0; protected $securityPolicy = null; protected $plugins = array(); protected $filters = array(); protected $resources = array ( 'file' => array ( 'class' => 'Dwoo_Template_File', 'compiler' => null ), 'string' => array ( 'class' => 'Dwoo_Template_String', 'compiler' => null ) ); protected $loader = null; protected $template = null; protected $runtimePlugins; protected $data; protected $scope; protected $scopeTree; protected $stack; protected $curBlock; protected $buffer; protected $pluginProxy; public function __construct($compileDir = null, $cacheDir = null) { if ($compileDir !== null) { $this->setCompileDir($compileDir); } if ($cacheDir !== null) { $this->setCacheDir($cacheDir); } } public function __clone() { $this->template = null; } public function output($tpl, $data = array(), Dwoo_ICompiler $compiler = null) { return $this->get($tpl, $data, $compiler, true); } public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { if ($this->template instanceof Dwoo_ITemplate) { $proxy = clone $this; return $proxy->get($_tpl, $data, $_compiler, $_output); } if ($_tpl instanceof Dwoo_ITemplate) { } elseif (is_string($_tpl) && file_exists($_tpl)) { $_tpl = new Dwoo_Template_File($_tpl); } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s first argument must be a Dwoo_ITemplate (i.e. Dwoo_Template_File) or a valid path to a template file', E_USER_NOTICE); } $this->template = $_tpl; if ($data instanceof Dwoo_IDataProvider) { $this->data = $data->getData(); } elseif (is_array($data)) { $this->data = $data; } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s data argument must be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array', E_USER_NOTICE); } $this->initGlobals($_tpl); $this->initRuntimeVars($_tpl); $file = $_tpl->getCachedTemplate($this); $doCache = $file === true; $cacheLoaded = is_string($file); if ($cacheLoaded === true) { if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { if ($doCache === true) { $dynamicId = uniqid(); } $out = include $_tpl->getCompiledTemplate($this, $_compiler); if ($out === false) { $_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)) { $this->getLoader()->loadPlugin('dynamic'); } $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId); } foreach ($this->filters as $filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { $out = call_user_func($filter, $out); } else { $out = call_user_func($filter, $this, $out); } } if ($doCache === true) { $file = $_tpl->cache($this, $out); if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { $this->template = null; if ($_output === true) { echo $out; } else { return $out; } } } } protected function initGlobals(Dwoo_ITemplate $tpl) { $this->globals = array ( 'version' => self::VERSION, 'ad' => '<a href="http://dwoo.org/">Powered by Dwoo</a>', 'now' => $_SERVER['REQUEST_TIME'], 'template' => $tpl->getName(), 'charset' => $this->charset, ); } protected function initRuntimeVars(Dwoo_ITemplate $tpl) { $this->runtimePlugins = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->curBlock = null; $this->buffer = ''; } public function addPlugin($name, $callback, $compilable = false) { $compilable = $compilable ? self::COMPILABLE_PLUGIN : 0; if (is_array($callback)) { if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0])); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0]), 'function'=>$callback[1]); } } elseif (class_exists($callback, false)) { if (is_subclass_of($callback, 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback, 'function'=>'process'); } } elseif (function_exists($callback)) { $this->plugins[$name] = array('type'=>self::FUNC_PLUGIN | $compilable, 'callback'=>$callback); } else { throw new Dwoo_Exception('Callback could not be processed correctly, please check that the function/class you used exists'); } } public function removePlugin($name) { if (isset($this->plugins[$name])) { unset($this->plugins[$name]); } } public function addFilter($callback, $autoload = false) { if ($autoload) { $class = 'Dwoo_Filter_'.$callback; if (!class_exists($class, false) && !function_exists($class)) { try { $this->getLoader()->loadPlugin($callback); } catch (Dwoo_Exception $e) { if (strstr($callback, 'Dwoo_Filter_')) { throw new Dwoo_Exception('Wrong filter name : '.$callback.', the "Dwoo_Filter_" prefix should not be used, please only use "'.str_replace('Dwoo_Filter_', '', $callback).'"'); } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } } } if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } $this->filters[] = $callback; } else { $this->filters[] = $callback; } } public function removeFilter($callback) { if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } elseif (($index = array_search($callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } else { $class = 'Dwoo_Filter_' . $callback; foreach ($this->filters as $index=>$filter) { if (is_array($filter) && $filter[0] instanceof $class) { unset($this->filters[$index]); break; } } } } public function addResource($name, $class, $compilerFactory = null) { if (strlen($name) < 2) { throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths'); } if (!class_exists($class)) { throw new Dwoo_Exception('Resource class does not exist'); } $interfaces = class_implements($class); if (in_array('Dwoo_ITemplate', $interfaces) === false) { throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate'); } $this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory); } public function removeResource($name) { unset($this->resources[$name]); if ($name==='file') { $this->resources['file'] = array('class'=>'Dwoo_Template_File', 'compiler'=>null); } } public function setLoader(Dwoo_ILoader $loader) { $this->loader = $loader; } public function getLoader() { if ($this->loader === null) { $this->loader = new Dwoo_Loader($this->getCompileDir()); } return $this->loader; } public function getCustomPlugins() { return $this->plugins; } public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR); } return $this->cacheDir; } public function setCacheDir($dir) { $this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->cacheDir) === false) { throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable'); } } public function getCompileDir() { if ($this->compileDir === null) { $this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR); } return $this->compileDir; } public function setCompileDir($dir) { $this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->compileDir) === false) { throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable'); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds) { $this->cacheTime = (int) $seconds; } public function getCharset() { return $this->charset; } public function setCharset($charset) { $this->charset = strtolower((string) $charset); } public function getTemplate() { return $this->template; } public function setDefaultCompilerFactory($resourceName, $compilerFactory) { $this->resources[$resourceName]['compiler'] = $compilerFactory; } public function getDefaultCompilerFactory($resourceName) { return $this->resources[$resourceName]['compiler']; } public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } public function getSecurityPolicy() { return $this->securityPolicy; } public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->pluginProxy = $pluginProxy; } public function getPluginProxy() { return $this->pluginProxy; } public function isCached(Dwoo_ITemplate $tpl) { return is_string($tpl->getCachedTemplate($this)); } public function clearCache($olderThan=-1) { $cacheDirs = new RecursiveDirectoryIterator($this->getCacheDir()); $cache = new RecursiveIteratorIterator($cacheDirs); $expired = time() - $olderThan; $count = 0; foreach ($cache as $file) { if ($cache->isDot() || $cache->isDir() || substr($file, -5) !== '.html') { continue; } if ($cache->getCTime() < $expired) { $count += unlink((string) $file) ? 1 : 0; } } return $count; } public function templateFactory($resourceName, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (isset($this->resources[$resourceName])) { return call_user_func(array($this->resources[$resourceName]['class'], 'templateFactory'), $this, $resourceId, $cacheTime, $cacheId, $compileId, $parentTemplate); } else { throw new Dwoo_Exception('Unknown resource type : '.$resourceName); } } public function isArray($value, $checkIsEmpty=false, $allowNonCountable=false) { if (is_array($value) === true) { if ($checkIsEmpty === false) { return true; } else { return count($value) > 0; } } elseif ($value instanceof Iterator || $value instanceof ArrayAccess) { if ($checkIsEmpty === false) { return true; } else { if ($allowNonCountable === false) { return count($value) > 0; } else { if ($value instanceof Countable) { return count($value) > 0; } else { $value->rewind(); return $value->valid(); } } } } return false; } public function triggerError($message, $level=E_USER_NOTICE) { if (!($tplIdentifier = $this->template->getResourceIdentifier())) { $tplIdentifier = $this->template->getResourceName(); } trigger_error('Dwoo error (in '.$tplIdentifier.') : '.$message, $level); } public function addStack($blockName, array $args=array()) { if (isset($this->plugins[$blockName])) { $class = $this->plugins[$blockName]['class']; } else { $class = 'Dwoo_Plugin_'.$blockName; } if ($this->curBlock !== null) { $this->curBlock->buffer(ob_get_contents()); ob_clean(); } else { $this->buffer .= ob_get_contents(); ob_clean(); } $block = new $class($this); $cnt = count($args); if ($cnt===0) { $block->init(); } elseif ($cnt===1) { $block->init($args[0]); } elseif ($cnt===2) { $block->init($args[0], $args[1]); } elseif ($cnt===3) { $block->init($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $block->init($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($block,'init'), $args); } $this->stack[] = $this->curBlock = $block; return $block; } public function delStack() { $args = func_get_args(); $this->curBlock->buffer(ob_get_contents()); ob_clean(); $cnt = count($args); if ($cnt===0) { $this->curBlock->end(); } elseif ($cnt===1) { $this->curBlock->end($args[0]); } elseif ($cnt===2) { $this->curBlock->end($args[0], $args[1]); } elseif ($cnt===3) { $this->curBlock->end($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $this->curBlock->end($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($this->curBlock, 'end'), $args); } $tmp = array_pop($this->stack); if (count($this->stack) > 0) { $this->curBlock = end($this->stack); $this->curBlock->buffer($tmp->process()); } else { $this->curBlock = null; echo $tmp->process(); } unset($tmp); } public function getParentBlock(Dwoo_Block_Plugin $block) { $index = array_search($block, $this->stack, true); if ($index !== false && $index > 0) { return $this->stack[$index-1]; } return false; } public function findBlock($type) { if (isset($this->plugins[$type])) { $type = $this->plugins[$type]['class']; } else { $type = 'Dwoo_Plugin_'.str_replace('Dwoo_Plugin_', '', $type); } $keys = array_keys($this->stack); while (($key = array_pop($keys)) !== false) { if ($this->stack[$key] instanceof $type) { return $this->stack[$key]; } } return false; } protected function getObjectPlugin($class) { if (isset($this->runtimePlugins[$class])) { return $this->runtimePlugins[$class]; } return $this->runtimePlugins[$class] = new $class($this); } public function classCall($plugName, array $params = array()) { $class = 'Dwoo_Plugin_'.$plugName; $plugin = $this->getObjectPlugin($class); $cnt = count($params); if ($cnt===0) { return $plugin->process(); } elseif ($cnt===1) { return $plugin->process($params[0]); } elseif ($cnt===2) { return $plugin->process($params[0], $params[1]); } elseif ($cnt===3) { return $plugin->process($params[0], $params[1], $params[2]); } elseif ($cnt===4) { return $plugin->process($params[0], $params[1], $params[2], $params[3]); } else { return call_user_func_array(array($plugin, 'process'), $params); } } public function arrayMap($callback, array $params) { if ($params[0] === $this) { $addThis = true; array_shift($params); } if ((is_array($params[0]) || ($params[0] instanceof Iterator && $params[0] instanceof ArrayAccess))) { if (empty($params[0])) { return $params[0]; } $out = array(); $cnt = count($params); if (isset($addThis)) { array_unshift($params, $this); $items = $params[1]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } } else { $items = $params[0]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2]); } } elseif ($cnt===4) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } } return $out; } else { return $params[0]; } } public function readVarInto($varstr, $data) { if ($data === null) { return null; } if (is_array($varstr) === false) { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } else { $m = $varstr; } unset($varstr); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($data) || $data instanceof ArrayAccess) && isset($data[$m[2][$k]])) { $data = $data[$m[2][$k]]; } else { return null; } } else { if (is_object($data)) { $data = $data->$m[2][$k]; } else { return null; } } } return $data; } public function readParentVar($parentLevels, $varstr = null) { $tree = $this->scopeTree; $cur = $this->data; while ($parentLevels--!==0) { array_pop($tree); } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } if ($varstr!==null) { return $this->readVarInto($varstr, $cur); } else { return $cur; } } public function readVar($varstr) { if (is_array($varstr)===true) { $m = $varstr; unset($varstr); } else { if (strstr($varstr, '.') === false && strstr($varstr, '[') === false && strstr($varstr, '->') === false) { if ($varstr === 'dwoo') { return $this->globals; } elseif ($varstr === '__' || $varstr === '_root' ) { return $this->data; $varstr = substr($varstr, 6); } elseif ($varstr === '_' || $varstr === '_parent') { $varstr = '.'.$varstr; $tree = $this->scopeTree; $cur = $this->data; array_pop($tree); while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } return $cur; } $cur = $this->scope; if (isset($cur[$varstr])) { return $cur[$varstr]; } else { return null; } } if (substr($varstr, 0, 1) === '.') { $varstr = 'dwoo'.$varstr; } preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } $i = $m[2][0]; if ($i === 'dwoo') { $cur = $this->globals; array_shift($m[2]); array_shift($m[1]); switch ($m[2][0]) { case 'get': $cur = $_GET; break; case 'post': $cur = $_POST; break; case 'session': $cur = $_SESSION; break; case 'cookies': case 'cookie': $cur = $_COOKIE; break; case 'server': $cur = $_SERVER; break; case 'env': $cur = $_ENV; break; case 'request': $cur = $_REQUEST; break; case 'const': array_shift($m[2]); if (defined($m[2][0])) { return constant($m[2][0]); } else { return null; } } if ($cur !== $this->globals) { array_shift($m[2]); array_shift($m[1]); } } elseif ($i === '__' || $i === '_root') { $cur = $this->data; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_' || $i === '_parent') { $tree = $this->scopeTree; $cur = $this->data; while (true) { array_pop($tree); array_shift($m[2]); array_shift($m[1]); if (current($m[2]) === '_' || current($m[2]) === '_parent') { continue; } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } break; } } else { $cur = $this->scope; } while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) { $cur = $cur[$m[2][$k]]; } else { return null; } } elseif ($sep === '->') { if (is_object($cur)) { $cur = $cur->$m[2][$k]; } else { return null; } } else { return null; } } return $cur; } public function assignInScope($value, $scope) { $tree =& $this->scopeTree; $data =& $this->data; if (!is_string($scope)) { return $this->triggerError('Assignments must be done into strings, ('.gettype($scope).') '.var_export($scope, true).' given', E_USER_ERROR); } if (strstr($scope, '.') === false && strstr($scope, '->') === false) { $this->scope[$scope] = $value; } else { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $scope, $m); $cur =& $this->scope; $last = array(array_pop($m[1]), array_pop($m[2])); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if (is_array($cur) === false) { $cur = array(); } $cur =& $cur[$m[2][$k]]; } elseif ($sep === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur =& $cur->$m[2][$k]; } else { return false; } } if ($last[0] === '.' || $last[0] === '[' || $last[0] === '') { if (is_array($cur) === false) { $cur = array(); } $cur[$last[1]] = $value; } elseif ($last[0] === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur->$last[1] = $value; } else { return false; } } } public function setScope($scope, $absolute = false) { $old = $this->scopeTree; if (is_string($scope)===true) { $scope = explode('.', $scope); } if ($absolute===true) { $this->scope =& $this->data; $this->scopeTree = array(); } while (($bit = array_shift($scope)) !== null) { if ($bit === '_' || $bit === '_parent') { array_pop($this->scopeTree); $this->scope =& $this->data; $cnt = count($this->scopeTree); for ($i=0;$i<$cnt;$i++) $this->scope =& $this->scope[$this->scopeTree[$i]]; } elseif ($bit === '__' || $bit === '_root') { $this->scope =& $this->data; $this->scopeTree = array(); } elseif (isset($this->scope[$bit])) { $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } else { unset($this->scope); $this->scope = null; } } return $old; } public function getData() { return $this->data; } public function &getScope() { return $this->scope; } public function forceScope($scope) { return $this->setScope($scope, true); } } interface Dwoo_IPluginProxy { public function handles($name); public function getCode($name, $params); public function getCallback($name); public function getLoader($name); } interface Dwoo_IElseable { } interface Dwoo_ILoader { public function loadPlugin($class, $forceRehash = true); } class Dwoo_Loader implements Dwoo_ILoader { protected $paths = array(); protected $classPath = array(); protected $cacheDir; protected $corePluginDir; public function __construct($cacheDir) { $this->corePluginDir = DWOO_DIRECTORY . 'plugins'; $this->cacheDir = $cacheDir . DIRECTORY_SEPARATOR; $foo = @file_get_contents($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); } } protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } $list = glob($path.DIRECTORY_SEPARATOR.'*'); if (is_array($list)) { foreach ($list as $f) { if (is_dir($f)) { $this->rebuildClassPathCache($f, false); } else { $this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f; } } } if ($cacheFile!==false) { if (!file_put_contents($cacheFile, serialize($this->classPath))) { throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()'); } $this->classPath += $tmp; } } public function loadPlugin($class, $forceRehash = true) { if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); foreach ($this->paths as $path=>$file) { $this->rebuildClassPathCache($path, $file); } if (isset($this->classPath[$class])) { include $this->classPath[$class]; } else { throw new Dwoo_Exception('Plugin <em>'.$class.'</em> can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } else { throw new Dwoo_Exception('Plugin <em>'.$class.'</em> can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } } public function addDirectory($pluginDirectory) { $pluginDir = realpath($pluginDirectory); if (!$pluginDir) { throw new Dwoo_Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory); } $cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php'; $this->paths[$pluginDir] = $cacheFile; $foo = @file_get_contents($cacheFile); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($pluginDir, $cacheFile); } } } class Dwoo_Exception extends Exception { } class Dwoo_Security_Policy { const PHP_ENCODE = 1; const PHP_REMOVE = 2; const PHP_ALLOW = 3; const CONST_DISALLOW = false; const CONST_ALLOW = true; protected $allowedPhpFunctions = array ( 'str_repeat', 'number_format', 'htmlentities', 'htmlspecialchars', 'long2ip', 'strlen', 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array', ); protected $allowedDirectories = array(); protected $phpHandling = self::PHP_REMOVE; protected $constHandling = self::CONST_DISALLOW; public function allowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) $this->allowedPhpFunctions[strtolower($fname)] = true; else $this->allowedPhpFunctions[strtolower($func)] = true; } public function disallowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) unset($this->allowedPhpFunctions[strtolower($fname)]); else unset($this->allowedPhpFunctions[strtolower($func)]); } public function getAllowedPhpFunctions() { return $this->allowedPhpFunctions; } public function allowDirectory($path) { if (is_array($path)) foreach ($path as $dir) $this->allowedDirectories[realpath($dir)] = true; else $this->allowedDirectories[realpath($path)] = true; } public function disallowDirectory($path) { if (is_array($path)) foreach ($path as $dir) unset($this->allowedDirectories[realpath($dir)]); else unset($this->allowedDirectories[realpath($path)]); } public function getAllowedDirectories() { return $this->allowedDirectories; } public function setPhpHandling($level = self::PHP_REMOVE) { $this->phpHandling = $level; } public function getPhpHandling() { return $this->phpHandling; } public function setConstantHandling($level = self::CONST_DISALLOW) { $this->constHandling = $level; } public function getConstantHandling() { return $this->constHandling; } } class Dwoo_Security_Exception extends Dwoo_Exception { } interface Dwoo_ICompilable { } interface Dwoo_ICompiler { public function compile(Dwoo $dwoo, Dwoo_ITemplate $template); public function setCustomPlugins(array $customPlugins); public function setSecurityPolicy(Dwoo_Security_Policy $policy = null); } interface Dwoo_IDataProvider { public function getData(); } interface Dwoo_ITemplate { public function getCacheTime(); public function setCacheTime($seconds = null); public function getCachedTemplate(Dwoo $dwoo); public function cache(Dwoo $dwoo, $output); public function clearCache(Dwoo $dwoo, $olderThan = -1); public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null); public function getName(); public function getResourceName(); public function getResourceIdentifier(); public function getSource(); public function getUid(); public function getCompiler(); public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null); } interface Dwoo_ICompilable_Block { } abstract class Dwoo_Plugin { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= str_replace($delim, '\\'.$delim, '""'); } elseif (substr($val, 0, 1) === $delim && substr($val, -1) === $delim) { $out .= str_replace($delim, '\\'.$delim, '"'.substr($val, 1, -1).'"'); } else { $out .= str_replace($delim, '\\'.$delim, '"') . $delim . '.'.$val.'.' . $delim . str_replace($delim, '\\'.$delim, '"'); } } return ltrim($out); } } abstract class Dwoo_Block_Plugin extends Dwoo_Plugin { protected $buffer = ''; public function buffer($input) { $this->buffer .= $input; } public function end() { } public function process() { return $this->buffer; } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE; } } abstract class Dwoo_Filter { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } abstract public function process($input); } abstract class Dwoo_Processor { protected $compiler; public function __construct(Dwoo_Compiler $compiler) { $this->compiler = $compiler; } abstract public function process($input); } class Dwoo_Template_String implements Dwoo_ITemplate { protected $name; protected $compileId; protected $cacheId; protected $cacheTime; protected $compilationEnforced; protected static $cache = array('cached'=>array(), 'compiled'=>array()); protected $compiler; protected $chmod = 0777; public function __construct($templateString, $cacheTime = null, $cacheId = null, $compileId = null) { $this->template = $templateString; if (function_exists('hash')) { $this->name = hash('md4', $templateString); } else { $this->name = md5($templateString); } $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds = null) { $this->cacheTime = $seconds; } public function getChmod() { return $this->chmod; } public function setChmod($mask = null) { $this->chmod = $mask; } public function getName() { return $this->name; } public function getResourceName() { return 'string'; } public function getResourceIdentifier() { return false; } public function getSource() { return $this->template; } public function getUid() { return $this->name; } public function getCompiler() { return $this->compiler; } public function forceCompilation() { $this->compilationEnforced = true; } public function getCachedTemplate(Dwoo $dwoo) { if ($this->cacheTime !== null) { $cacheLength = $this->cacheTime; } else { $cacheLength = $dwoo->getCacheTime(); } if ($cacheLength === 0) { return false; } $cachedFile = $this->getCacheFilename($dwoo); if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) { return $cachedFile; } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength))) { self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } else { return true; } } public function cache(Dwoo $dwoo, $output) { $cacheDir = $dwoo->getCacheDir(); $cachedFile = $this->getCacheFilename($dwoo); $temp = tempnam($cacheDir, 'temp'); if (!($file = @fopen($temp, 'wb'))) { $temp = $cacheDir . DIRECTORY_SEPARATOR . uniqid('temp'); if (!($file = @fopen($temp, 'wb'))) { trigger_error('Error writing temporary file \''.$temp.'\'', E_USER_WARNING); return false; } } fwrite($file, $output); fclose($file); $this->makeDirectory(dirname($cachedFile)); if (!@rename($temp, $cachedFile)) { @unlink($cachedFile); @rename($temp, $cachedFile); } if ($this->chmod !== null) { chmod($cachedFile, $this->chmod); } self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } public function clearCache(Dwoo $dwoo, $olderThan = -1) { $cachedFile = $this->getCacheFilename($dwoo); return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile)); } public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null) { $compiledFile = $this->getCompiledFilename($dwoo); if ($this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) { } elseif ($this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) { self::$cache['compiled'][$this->compileId] = true; } else { $this->compilationEnforced = false; if ($compiler === null) { $compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName()); if ($compiler === null || $compiler === array('Dwoo_Compiler', 'compilerFactory')) { if (class_exists('Dwoo_Compiler', false) === false) { include DWOO_DIRECTORY . 'Dwoo/Compiler.php'; } $compiler = Dwoo_Compiler::compilerFactory(); } else { $compiler = call_user_func($compiler); } } $this->compiler = $compiler; $compiler->setCustomPlugins($dwoo->getCustomPlugins()); $compiler->setSecurityPolicy($dwoo->getSecurityPolicy()); $this->makeDirectory(dirname($compiledFile)); file_put_contents($compiledFile, $compiler->compile($dwoo, $this)); if ($this->chmod !== null) { chmod($compiledFile, $this->chmod); } self::$cache['compiled'][$this->compileId] = true; } return $compiledFile; } protected function isValidCompiledFile($file) { return file_exists($file); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } protected function getCacheFilename(Dwoo $dwoo) { if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']); } else { $cacheId = ''; } $this->getCompiledFilename($dwoo); $this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } return $dwoo->getCacheDir() . $this->cacheId.'.html'; } protected function makeDirectory($path) { if (is_dir($path) === true) { return; } if ($this->chmod !== null) { mkdir($path, $this->chmod, true); } else { mkdir($path, 0777, true); } } } class Dwoo_Template_File extends Dwoo_Template_String { protected $file; protected $includePath = null; protected $resolvedPath = null; public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = null) { $this->file = $file; $this->name = basename($file); $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if (is_string($includePath)) { $this->includePath = array($includePath); } elseif (is_array($includePath)) { $this->includePath = $includePath; } } public function setIncludePath($paths) { if (is_array($paths) === false) { $paths = array($paths); } $this->includePath = $paths; $this->resolvedPath = null; } public function getIncludePath() { return $this->includePath; } protected function isValidCompiledFile($file) { return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file); } public function getSource() { return file_get_contents($this->getResourceIdentifier()); } public function getResourceName() { return 'file'; } public function getResourceIdentifier() { if ($this->resolvedPath !== null) { return $this->resolvedPath; } elseif ($this->includePath === null) { return $this->file; } else { foreach ($this->includePath as $path) { if (file_exists($path.DIRECTORY_SEPARATOR.$this->file) === true) { $this->resolvedPath = $path . DIRECTORY_SEPARATOR . $this->file; return $this->resolvedPath; } } throw new Dwoo_Exception('Template "'.$this->file.'" could not be found in any of your include path(s)'); } } public function getUid() { return (string) filemtime($this->getResourceIdentifier()); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (DIRECTORY_SEPARATOR === '\\') { $resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array('\\t', '\\n', '\\r', '\\f', '\\v'), $resourceId); } $resourceId = strtr($resourceId, '\\', '/'); $includePath = null; if (file_exists($resourceId) === false) { if ($parentTemplate === null) { $parentTemplate = $dwoo->getTemplate(); } if ($parentTemplate instanceof Dwoo_Template_File) { if ($includePath = $parentTemplate->getIncludePath()) { if (strstr($resourceId, '../')) { throw new Dwoo_Exception('When using an include path you can not reference a template into a parent directory (using ../)'); } } else { $resourceId = dirname($parentTemplate->getResourceIdentifier()).DIRECTORY_SEPARATOR.$resourceId; if (file_exists($resourceId) === false) { return null; } } } else { return null; } } if ($policy = $dwoo->getSecurityPolicy()) { while (true) { if (preg_match('{^([a-z]+?)://}i', $resourceId)) { throw new Dwoo_Security_Exception('The security policy prevents you to read files from external sources : <em>'.$resourceId.'</em>.'); } if ($includePath) { break; } $resourceId = realpath($resourceId); $dirs = $policy->getAllowedDirectories(); foreach ($dirs as $dir=>$dummy) { if (strpos($resourceId, $dir) === 0) { break 2; } } throw new Dwoo_Security_Exception('The security policy prevents you to read <em>'.$resourceId.'</em>'); } } return new Dwoo_Template_File($resourceId, $cacheTime, $cacheId, $compileId, $includePath); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-')); } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } } class Dwoo_Data implements Dwoo_IDataProvider { protected $data = array(); public function getData() { return $this->data; } public function clear($name = null) { if ($name === null) { $this->data = array(); } elseif (is_array($name)) { foreach ($name as $index) unset($this->data[$index]); } else { unset($this->data[$name]); } } public function setData(array $data) { $this->data = $data; } public function mergeData(array $data) { $args = func_get_args(); while (list(,$v) = each($args)) { if (is_array($v)) { $this->data = array_merge($this->data, $v); } } } public function assign($name, $val = null) { if (is_array($name)) { reset($name); while (list($k,$v) = each($name)) $this->data[$k] = $v; } else { $this->data[$name] = $val; } } public function __set($name, $value) { $this->assign($name, $value); } public function assignByRef($name, &$val) { $this->data[$name] =& $val; } public function append($name, $val = null, $merge = false) { if (is_array($name)) { foreach ($name as $key=>$val) { if (isset($this->data[$key]) && !is_array($this->data[$key])) { settype($this->data[$key], 'array'); } if ($merge === true && is_array($val)) { $this->data[$key] = $val + $this->data[$key]; } else { $this->data[$key][] = $val; } } } elseif ($val !== null) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { $this->data[$name] = $val + $this->data[$name]; } else { $this->data[$name][] = $val; } } } public function appendByRef($name, &$val, $merge = false) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { foreach ($val as $key => &$val) { $this->data[$name][$key] =& $val; } } else { $this->data[$name][] =& $val; } } public function isAssigned($name) { return isset($this->data[$name]); } public function __isset($name) { return isset($this->data[$name]); } public function unassign($name) { unset($this->data[$name]); } public function __unset($name) { unset($this->data[$name]); } public function get($name) { return $this->__get($name); } public function __get($name) { if (isset($this->data[$name])) { return $this->data[$name]; } else { throw new Dwoo_Exception('Tried to read a value that was not assigned yet : "'.$name.'"'); } } }
2 +<?php define('DWOO_DIRECTORY', dirname(__FILE__) . DIRECTORY_SEPARATOR); class Dwoo { const VERSION = '1.0.0'; const RELEASE_TAG = 14; const CLASS_PLUGIN = 1; const FUNC_PLUGIN = 2; const NATIVE_PLUGIN = 4; const BLOCK_PLUGIN = 8; const COMPILABLE_PLUGIN = 16; const CUSTOM_PLUGIN = 32; const SMARTY_MODIFIER = 64; const SMARTY_BLOCK = 128; const SMARTY_FUNCTION = 256; const PROXY_PLUGIN = 512; protected $charset = 'utf-8'; protected $globals; protected $compileDir; protected $cacheDir; protected $cacheTime = 0; protected $securityPolicy = null; protected $plugins = array(); protected $filters = array(); protected $resources = array ( 'file' => array ( 'class' => 'Dwoo_Template_File', 'compiler' => null ), 'string' => array ( 'class' => 'Dwoo_Template_String', 'compiler' => null ) ); protected $loader = null; protected $template = null; protected $runtimePlugins; protected $data; protected $scope; protected $scopeTree; protected $stack; protected $curBlock; protected $buffer; protected $pluginProxy; public function __construct($compileDir = null, $cacheDir = null) { if ($compileDir !== null) { $this->setCompileDir($compileDir); } if ($cacheDir !== null) { $this->setCacheDir($cacheDir); } } public function __clone() { $this->template = null; } public function output($tpl, $data = array(), Dwoo_ICompiler $compiler = null) { return $this->get($tpl, $data, $compiler, true); } public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { if ($this->template instanceof Dwoo_ITemplate) { $proxy = clone $this; return $proxy->get($_tpl, $data, $_compiler, $_output); } if ($_tpl instanceof Dwoo_ITemplate) { } elseif (is_string($_tpl) && file_exists($_tpl)) { $_tpl = new Dwoo_Template_File($_tpl); } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s first argument must be a Dwoo_ITemplate (i.e. Dwoo_Template_File) or a valid path to a template file', E_USER_NOTICE); } $this->template = $_tpl; if ($data instanceof Dwoo_IDataProvider) { $this->data = $data->getData(); } elseif (is_array($data)) { $this->data = $data; } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s data argument must be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array', E_USER_NOTICE); } $this->initGlobals($_tpl); $this->initRuntimeVars($_tpl); $file = $_tpl->getCachedTemplate($this); $doCache = $file === true; $cacheLoaded = is_string($file); if ($cacheLoaded === true) { if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { if ($doCache === true) { $dynamicId = uniqid(); } $out = include $_tpl->getCompiledTemplate($this, $_compiler); if ($out === false) { $_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)) { $this->getLoader()->loadPlugin('dynamic'); } $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId); } foreach ($this->filters as $filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { $out = call_user_func($filter, $out); } else { $out = call_user_func($filter, $this, $out); } } if ($doCache === true) { $file = $_tpl->cache($this, $out); if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { $this->template = null; if ($_output === true) { echo $out; } else { return $out; } } } } protected function initGlobals(Dwoo_ITemplate $tpl) { $this->globals = array ( 'version' => self::VERSION, 'ad' => '<a href="http://dwoo.org/">Powered by Dwoo</a>', 'now' => $_SERVER['REQUEST_TIME'], 'template' => $tpl->getName(), 'charset' => $this->charset, ); } protected function initRuntimeVars(Dwoo_ITemplate $tpl) { $this->runtimePlugins = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->curBlock = null; $this->buffer = ''; } public function addPlugin($name, $callback, $compilable = false) { $compilable = $compilable ? self::COMPILABLE_PLUGIN : 0; if (is_array($callback)) { if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0])); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0]), 'function'=>$callback[1]); } } elseif (class_exists($callback, false)) { if (is_subclass_of($callback, 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback, 'function'=>'process'); } } elseif (function_exists($callback)) { $this->plugins[$name] = array('type'=>self::FUNC_PLUGIN | $compilable, 'callback'=>$callback); } else { throw new Dwoo_Exception('Callback could not be processed correctly, please check that the function/class you used exists'); } } public function removePlugin($name) { if (isset($this->plugins[$name])) { unset($this->plugins[$name]); } } public function addFilter($callback, $autoload = false) { if ($autoload) { $class = 'Dwoo_Filter_'.$callback; if (!class_exists($class, false) && !function_exists($class)) { try { $this->getLoader()->loadPlugin($callback); } catch (Dwoo_Exception $e) { if (strstr($callback, 'Dwoo_Filter_')) { throw new Dwoo_Exception('Wrong filter name : '.$callback.', the "Dwoo_Filter_" prefix should not be used, please only use "'.str_replace('Dwoo_Filter_', '', $callback).'"'); } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } } } if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } $this->filters[] = $callback; } else { $this->filters[] = $callback; } } public function removeFilter($callback) { if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } elseif (($index = array_search($callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } else { $class = 'Dwoo_Filter_' . $callback; foreach ($this->filters as $index=>$filter) { if (is_array($filter) && $filter[0] instanceof $class) { unset($this->filters[$index]); break; } } } } public function addResource($name, $class, $compilerFactory = null) { if (strlen($name) < 2) { throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths'); } if (!class_exists($class)) { throw new Dwoo_Exception('Resource class does not exist'); } $interfaces = class_implements($class); if (in_array('Dwoo_ITemplate', $interfaces) === false) { throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate'); } $this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory); } public function removeResource($name) { unset($this->resources[$name]); if ($name==='file') { $this->resources['file'] = array('class'=>'Dwoo_Template_File', 'compiler'=>null); } } public function setLoader(Dwoo_ILoader $loader) { $this->loader = $loader; } public function getLoader() { if ($this->loader === null) { $this->loader = new Dwoo_Loader($this->getCompileDir()); } return $this->loader; } public function getCustomPlugins() { return $this->plugins; } public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR); } return $this->cacheDir; } public function setCacheDir($dir) { $this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->cacheDir) === false) { throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable'); } } public function getCompileDir() { if ($this->compileDir === null) { $this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR); } return $this->compileDir; } public function setCompileDir($dir) { $this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->compileDir) === false) { throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable'); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds) { $this->cacheTime = (int) $seconds; } public function getCharset() { return $this->charset; } public function setCharset($charset) { $this->charset = strtolower((string) $charset); } public function getTemplate() { return $this->template; } public function setDefaultCompilerFactory($resourceName, $compilerFactory) { $this->resources[$resourceName]['compiler'] = $compilerFactory; } public function getDefaultCompilerFactory($resourceName) { return $this->resources[$resourceName]['compiler']; } public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } public function getSecurityPolicy() { return $this->securityPolicy; } public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->pluginProxy = $pluginProxy; } public function getPluginProxy() { return $this->pluginProxy; } public function isCached(Dwoo_ITemplate $tpl) { return is_string($tpl->getCachedTemplate($this)); } public function clearCache($olderThan=-1) { $cacheDirs = new RecursiveDirectoryIterator($this->getCacheDir()); $cache = new RecursiveIteratorIterator($cacheDirs); $expired = time() - $olderThan; $count = 0; foreach ($cache as $file) { if ($cache->isDot() || $cache->isDir() || substr($file, -5) !== '.html') { continue; } if ($cache->getCTime() < $expired) { $count += unlink((string) $file) ? 1 : 0; } } return $count; } public function templateFactory($resourceName, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (isset($this->resources[$resourceName])) { return call_user_func(array($this->resources[$resourceName]['class'], 'templateFactory'), $this, $resourceId, $cacheTime, $cacheId, $compileId, $parentTemplate); } else { throw new Dwoo_Exception('Unknown resource type : '.$resourceName); } } public function isArray($value, $checkIsEmpty=false, $allowNonCountable=false) { if (is_array($value) === true) { if ($checkIsEmpty === false) { return true; } else { return count($value) > 0; } } elseif ($value instanceof Iterator || $value instanceof ArrayAccess) { if ($checkIsEmpty === false) { return true; } else { if ($allowNonCountable === false) { return count($value) > 0; } else { if ($value instanceof Countable) { return count($value) > 0; } else { $value->rewind(); return $value->valid(); } } } } return false; } public function triggerError($message, $level=E_USER_NOTICE) { if (!($tplIdentifier = $this->template->getResourceIdentifier())) { $tplIdentifier = $this->template->getResourceName(); } trigger_error('Dwoo error (in '.$tplIdentifier.') : '.$message, $level); } public function addStack($blockName, array $args=array()) { if (isset($this->plugins[$blockName])) { $class = $this->plugins[$blockName]['class']; } else { $class = 'Dwoo_Plugin_'.$blockName; } if ($this->curBlock !== null) { $this->curBlock->buffer(ob_get_contents()); ob_clean(); } else { $this->buffer .= ob_get_contents(); ob_clean(); } $block = new $class($this); $cnt = count($args); if ($cnt===0) { $block->init(); } elseif ($cnt===1) { $block->init($args[0]); } elseif ($cnt===2) { $block->init($args[0], $args[1]); } elseif ($cnt===3) { $block->init($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $block->init($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($block,'init'), $args); } $this->stack[] = $this->curBlock = $block; return $block; } public function delStack() { $args = func_get_args(); $this->curBlock->buffer(ob_get_contents()); ob_clean(); $cnt = count($args); if ($cnt===0) { $this->curBlock->end(); } elseif ($cnt===1) { $this->curBlock->end($args[0]); } elseif ($cnt===2) { $this->curBlock->end($args[0], $args[1]); } elseif ($cnt===3) { $this->curBlock->end($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $this->curBlock->end($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($this->curBlock, 'end'), $args); } $tmp = array_pop($this->stack); if (count($this->stack) > 0) { $this->curBlock = end($this->stack); $this->curBlock->buffer($tmp->process()); } else { $this->curBlock = null; echo $tmp->process(); } unset($tmp); } public function getParentBlock(Dwoo_Block_Plugin $block) { $index = array_search($block, $this->stack, true); if ($index !== false && $index > 0) { return $this->stack[$index-1]; } return false; } public function findBlock($type) { if (isset($this->plugins[$type])) { $type = $this->plugins[$type]['class']; } else { $type = 'Dwoo_Plugin_'.str_replace('Dwoo_Plugin_', '', $type); } $keys = array_keys($this->stack); while (($key = array_pop($keys)) !== false) { if ($this->stack[$key] instanceof $type) { return $this->stack[$key]; } } return false; } protected function getObjectPlugin($class) { if (isset($this->runtimePlugins[$class])) { return $this->runtimePlugins[$class]; } return $this->runtimePlugins[$class] = new $class($this); } public function classCall($plugName, array $params = array()) { $class = 'Dwoo_Plugin_'.$plugName; $plugin = $this->getObjectPlugin($class); $cnt = count($params); if ($cnt===0) { return $plugin->process(); } elseif ($cnt===1) { return $plugin->process($params[0]); } elseif ($cnt===2) { return $plugin->process($params[0], $params[1]); } elseif ($cnt===3) { return $plugin->process($params[0], $params[1], $params[2]); } elseif ($cnt===4) { return $plugin->process($params[0], $params[1], $params[2], $params[3]); } else { return call_user_func_array(array($plugin, 'process'), $params); } } public function arrayMap($callback, array $params) { if ($params[0] === $this) { $addThis = true; array_shift($params); } if ((is_array($params[0]) || ($params[0] instanceof Iterator && $params[0] instanceof ArrayAccess))) { if (empty($params[0])) { return $params[0]; } $out = array(); $cnt = count($params); if (isset($addThis)) { array_unshift($params, $this); $items = $params[1]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } } else { $items = $params[0]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2]); } } elseif ($cnt===4) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } } return $out; } else { return $params[0]; } } public function readVarInto($varstr, $data) { if ($data === null) { return null; } if (is_array($varstr) === false) { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } else { $m = $varstr; } unset($varstr); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($data) || $data instanceof ArrayAccess) && isset($data[$m[2][$k]])) { $data = $data[$m[2][$k]]; } else { return null; } } else { if (is_object($data)) { $data = $data->$m[2][$k]; } else { return null; } } } return $data; } public function readParentVar($parentLevels, $varstr = null) { $tree = $this->scopeTree; $cur = $this->data; while ($parentLevels--!==0) { array_pop($tree); } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } if ($varstr!==null) { return $this->readVarInto($varstr, $cur); } else { return $cur; } } public function readVar($varstr) { if (is_array($varstr)===true) { $m = $varstr; unset($varstr); } else { if (strstr($varstr, '.') === false && strstr($varstr, '[') === false && strstr($varstr, '->') === false) { if ($varstr === 'dwoo') { return $this->globals; } elseif ($varstr === '__' || $varstr === '_root' ) { return $this->data; $varstr = substr($varstr, 6); } elseif ($varstr === '_' || $varstr === '_parent') { $varstr = '.'.$varstr; $tree = $this->scopeTree; $cur = $this->data; array_pop($tree); while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } return $cur; } $cur = $this->scope; if (isset($cur[$varstr])) { return $cur[$varstr]; } else { return null; } } if (substr($varstr, 0, 1) === '.') { $varstr = 'dwoo'.$varstr; } preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } $i = $m[2][0]; if ($i === 'dwoo') { $cur = $this->globals; array_shift($m[2]); array_shift($m[1]); switch ($m[2][0]) { case 'get': $cur = $_GET; break; case 'post': $cur = $_POST; break; case 'session': $cur = $_SESSION; break; case 'cookies': case 'cookie': $cur = $_COOKIE; break; case 'server': $cur = $_SERVER; break; case 'env': $cur = $_ENV; break; case 'request': $cur = $_REQUEST; break; case 'const': array_shift($m[2]); if (defined($m[2][0])) { return constant($m[2][0]); } else { return null; } } if ($cur !== $this->globals) { array_shift($m[2]); array_shift($m[1]); } } elseif ($i === '__' || $i === '_root') { $cur = $this->data; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_' || $i === '_parent') { $tree = $this->scopeTree; $cur = $this->data; while (true) { array_pop($tree); array_shift($m[2]); array_shift($m[1]); if (current($m[2]) === '_' || current($m[2]) === '_parent') { continue; } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } break; } } else { $cur = $this->scope; } while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) { $cur = $cur[$m[2][$k]]; } else { return null; } } elseif ($sep === '->') { if (is_object($cur)) { $cur = $cur->$m[2][$k]; } else { return null; } } else { return null; } } return $cur; } public function assignInScope($value, $scope) { $tree =& $this->scopeTree; $data =& $this->data; if (!is_string($scope)) { return $this->triggerError('Assignments must be done into strings, ('.gettype($scope).') '.var_export($scope, true).' given', E_USER_ERROR); } if (strstr($scope, '.') === false && strstr($scope, '->') === false) { $this->scope[$scope] = $value; } else { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $scope, $m); $cur =& $this->scope; $last = array(array_pop($m[1]), array_pop($m[2])); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if (is_array($cur) === false) { $cur = array(); } $cur =& $cur[$m[2][$k]]; } elseif ($sep === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur =& $cur->$m[2][$k]; } else { return false; } } if ($last[0] === '.' || $last[0] === '[' || $last[0] === '') { if (is_array($cur) === false) { $cur = array(); } $cur[$last[1]] = $value; } elseif ($last[0] === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur->$last[1] = $value; } else { return false; } } } public function setScope($scope, $absolute = false) { $old = $this->scopeTree; if (is_string($scope)===true) { $scope = explode('.', $scope); } if ($absolute===true) { $this->scope =& $this->data; $this->scopeTree = array(); } while (($bit = array_shift($scope)) !== null) { if ($bit === '_' || $bit === '_parent') { array_pop($this->scopeTree); $this->scope =& $this->data; $cnt = count($this->scopeTree); for ($i=0;$i<$cnt;$i++) $this->scope =& $this->scope[$this->scopeTree[$i]]; } elseif ($bit === '__' || $bit === '_root') { $this->scope =& $this->data; $this->scopeTree = array(); } elseif (isset($this->scope[$bit])) { $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } else { unset($this->scope); $this->scope = null; } } return $old; } public function getData() { return $this->data; } public function &getScope() { return $this->scope; } public function forceScope($scope) { return $this->setScope($scope, true); } } interface Dwoo_IPluginProxy { public function handles($name); public function getCode($name, $params); public function getCallback($name); public function getLoader($name); } interface Dwoo_IElseable { } interface Dwoo_ILoader { public function loadPlugin($class, $forceRehash = true); } class Dwoo_Loader implements Dwoo_ILoader { protected $paths = array(); protected $classPath = array(); protected $cacheDir; protected $corePluginDir; public function __construct($cacheDir) { $this->corePluginDir = DWOO_DIRECTORY . 'plugins'; $this->cacheDir = $cacheDir . DIRECTORY_SEPARATOR; $foo = @file_get_contents($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); } } protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } $list = glob($path.DIRECTORY_SEPARATOR.'*'); if (is_array($list)) { foreach ($list as $f) { if (is_dir($f)) { $this->rebuildClassPathCache($f, false); } else { $this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f; } } } if ($cacheFile!==false) { if (!file_put_contents($cacheFile, serialize($this->classPath))) { throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()'); } $this->classPath += $tmp; } } public function loadPlugin($class, $forceRehash = true) { if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); foreach ($this->paths as $path=>$file) { $this->rebuildClassPathCache($path, $file); } if (isset($this->classPath[$class])) { include $this->classPath[$class]; } else { throw new Dwoo_Exception('Plugin <em>'.$class.'</em> can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } else { throw new Dwoo_Exception('Plugin <em>'.$class.'</em> can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } } public function addDirectory($pluginDirectory) { $pluginDir = realpath($pluginDirectory); if (!$pluginDir) { throw new Dwoo_Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory); } $cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php'; $this->paths[$pluginDir] = $cacheFile; $foo = @file_get_contents($cacheFile); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($pluginDir, $cacheFile); } } } class Dwoo_Exception extends Exception { } class Dwoo_Security_Policy { const PHP_ENCODE = 1; const PHP_REMOVE = 2; const PHP_ALLOW = 3; const CONST_DISALLOW = false; const CONST_ALLOW = true; protected $allowedPhpFunctions = array ( 'str_repeat', 'number_format', 'htmlentities', 'htmlspecialchars', 'long2ip', 'strlen', 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array', ); protected $allowedDirectories = array(); protected $phpHandling = self::PHP_REMOVE; protected $constHandling = self::CONST_DISALLOW; public function allowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) $this->allowedPhpFunctions[strtolower($fname)] = true; else $this->allowedPhpFunctions[strtolower($func)] = true; } public function disallowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) unset($this->allowedPhpFunctions[strtolower($fname)]); else unset($this->allowedPhpFunctions[strtolower($func)]); } public function getAllowedPhpFunctions() { return $this->allowedPhpFunctions; } public function allowDirectory($path) { if (is_array($path)) foreach ($path as $dir) $this->allowedDirectories[realpath($dir)] = true; else $this->allowedDirectories[realpath($path)] = true; } public function disallowDirectory($path) { if (is_array($path)) foreach ($path as $dir) unset($this->allowedDirectories[realpath($dir)]); else unset($this->allowedDirectories[realpath($path)]); } public function getAllowedDirectories() { return $this->allowedDirectories; } public function setPhpHandling($level = self::PHP_REMOVE) { $this->phpHandling = $level; } public function getPhpHandling() { return $this->phpHandling; } public function setConstantHandling($level = self::CONST_DISALLOW) { $this->constHandling = $level; } public function getConstantHandling() { return $this->constHandling; } } class Dwoo_Security_Exception extends Dwoo_Exception { } interface Dwoo_ICompilable { } interface Dwoo_ICompiler { public function compile(Dwoo $dwoo, Dwoo_ITemplate $template); public function setCustomPlugins(array $customPlugins); public function setSecurityPolicy(Dwoo_Security_Policy $policy = null); } interface Dwoo_IDataProvider { public function getData(); } interface Dwoo_ITemplate { public function getCacheTime(); public function setCacheTime($seconds = null); public function getCachedTemplate(Dwoo $dwoo); public function cache(Dwoo $dwoo, $output); public function clearCache(Dwoo $dwoo, $olderThan = -1); public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null); public function getName(); public function getResourceName(); public function getResourceIdentifier(); public function getSource(); public function getUid(); public function getCompiler(); public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null); } interface Dwoo_ICompilable_Block { } abstract class Dwoo_Plugin { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= str_replace($delim, '\\'.$delim, '""'); } elseif (substr($val, 0, 1) === $delim && substr($val, -1) === $delim) { $out .= str_replace($delim, '\\'.$delim, '"'.substr($val, 1, -1).'"'); } else { $out .= str_replace($delim, '\\'.$delim, '"') . $delim . '.'.$val.'.' . $delim . str_replace($delim, '\\'.$delim, '"'); } } return ltrim($out); } } abstract class Dwoo_Block_Plugin extends Dwoo_Plugin { protected $buffer = ''; public function buffer($input) { $this->buffer .= $input; } public function end() { } public function process() { return $this->buffer; } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE; } } abstract class Dwoo_Filter { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } abstract public function process($input); } abstract class Dwoo_Processor { protected $compiler; public function __construct(Dwoo_Compiler $compiler) { $this->compiler = $compiler; } abstract public function process($input); } class Dwoo_Template_String implements Dwoo_ITemplate { protected $name; protected $compileId; protected $cacheId; protected $cacheTime; protected $compilationEnforced; protected static $cache = array('cached'=>array(), 'compiled'=>array()); protected $compiler; protected $chmod = 0777; public function __construct($templateString, $cacheTime = null, $cacheId = null, $compileId = null) { $this->template = $templateString; if (function_exists('hash')) { $this->name = hash('md4', $templateString); } else { $this->name = md5($templateString); } $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds = null) { $this->cacheTime = $seconds; } public function getChmod() { return $this->chmod; } public function setChmod($mask = null) { $this->chmod = $mask; } public function getName() { return $this->name; } public function getResourceName() { return 'string'; } public function getResourceIdentifier() { return false; } public function getSource() { return $this->template; } public function getUid() { return $this->name; } public function getCompiler() { return $this->compiler; } public function forceCompilation() { $this->compilationEnforced = true; } public function getCachedTemplate(Dwoo $dwoo) { if ($this->cacheTime !== null) { $cacheLength = $this->cacheTime; } else { $cacheLength = $dwoo->getCacheTime(); } if ($cacheLength === 0) { return false; } $cachedFile = $this->getCacheFilename($dwoo); if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) { return $cachedFile; } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength))) { self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } else { return true; } } public function cache(Dwoo $dwoo, $output) { $cacheDir = $dwoo->getCacheDir(); $cachedFile = $this->getCacheFilename($dwoo); $temp = tempnam($cacheDir, 'temp'); if (!($file = @fopen($temp, 'wb'))) { $temp = $cacheDir . DIRECTORY_SEPARATOR . uniqid('temp'); if (!($file = @fopen($temp, 'wb'))) { trigger_error('Error writing temporary file \''.$temp.'\'', E_USER_WARNING); return false; } } fwrite($file, $output); fclose($file); $this->makeDirectory(dirname($cachedFile)); if (!@rename($temp, $cachedFile)) { @unlink($cachedFile); @rename($temp, $cachedFile); } if ($this->chmod !== null) { chmod($cachedFile, $this->chmod); } self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } public function clearCache(Dwoo $dwoo, $olderThan = -1) { $cachedFile = $this->getCacheFilename($dwoo); return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile)); } public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null) { $compiledFile = $this->getCompiledFilename($dwoo); if ($this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) { } elseif ($this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) { self::$cache['compiled'][$this->compileId] = true; } else { $this->compilationEnforced = false; if ($compiler === null) { $compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName()); if ($compiler === null || $compiler === array('Dwoo_Compiler', 'compilerFactory')) { if (class_exists('Dwoo_Compiler', false) === false) { include DWOO_DIRECTORY . 'Dwoo/Compiler.php'; } $compiler = Dwoo_Compiler::compilerFactory(); } else { $compiler = call_user_func($compiler); } } $this->compiler = $compiler; $compiler->setCustomPlugins($dwoo->getCustomPlugins()); $compiler->setSecurityPolicy($dwoo->getSecurityPolicy()); $this->makeDirectory(dirname($compiledFile)); file_put_contents($compiledFile, $compiler->compile($dwoo, $this)); if ($this->chmod !== null) { chmod($compiledFile, $this->chmod); } self::$cache['compiled'][$this->compileId] = true; } return $compiledFile; } protected function isValidCompiledFile($file) { return file_exists($file); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } protected function getCacheFilename(Dwoo $dwoo) { if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']); } else { $cacheId = ''; } $this->getCompiledFilename($dwoo); $this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } return $dwoo->getCacheDir() . $this->cacheId.'.html'; } protected function makeDirectory($path) { if (is_dir($path) === true) { return; } if ($this->chmod !== null) { mkdir($path, $this->chmod, true); } else { mkdir($path, 0777, true); } } } class Dwoo_Template_File extends Dwoo_Template_String { protected $file; protected $includePath = null; protected $resolvedPath = null; public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = null) { $this->file = $file; $this->name = basename($file); $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if (is_string($includePath)) { $this->includePath = array($includePath); } elseif (is_array($includePath)) { $this->includePath = $includePath; } } public function setIncludePath($paths) { if (is_array($paths) === false) { $paths = array($paths); } $this->includePath = $paths; $this->resolvedPath = null; } public function getIncludePath() { return $this->includePath; } protected function isValidCompiledFile($file) { return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file); } public function getSource() { return file_get_contents($this->getResourceIdentifier()); } public function getResourceName() { return 'file'; } public function getResourceIdentifier() { if ($this->resolvedPath !== null) { return $this->resolvedPath; } elseif ($this->includePath === null) { return $this->file; } else { foreach ($this->includePath as $path) { if (file_exists($path.DIRECTORY_SEPARATOR.$this->file) === true) { $this->resolvedPath = $path . DIRECTORY_SEPARATOR . $this->file; return $this->resolvedPath; } } throw new Dwoo_Exception('Template "'.$this->file.'" could not be found in any of your include path(s)'); } } public function getUid() { return (string) filemtime($this->getResourceIdentifier()); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (DIRECTORY_SEPARATOR === '\\') { $resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array('\\t', '\\n', '\\r', '\\f', '\\v'), $resourceId); } $resourceId = strtr($resourceId, '\\', '/'); $includePath = null; if (file_exists($resourceId) === false) { if ($parentTemplate === null) { $parentTemplate = $dwoo->getTemplate(); } if ($parentTemplate instanceof Dwoo_Template_File) { if ($includePath = $parentTemplate->getIncludePath()) { if (strstr($resourceId, '../')) { throw new Dwoo_Exception('When using an include path you can not reference a template into a parent directory (using ../)'); } } else { $resourceId = dirname($parentTemplate->getResourceIdentifier()).DIRECTORY_SEPARATOR.$resourceId; if (file_exists($resourceId) === false) { return null; } } } else { return null; } } if ($policy = $dwoo->getSecurityPolicy()) { while (true) { if (preg_match('{^([a-z]+?)://}i', $resourceId)) { throw new Dwoo_Security_Exception('The security policy prevents you to read files from external sources : <em>'.$resourceId.'</em>.'); } if ($includePath) { break; } $resourceId = realpath($resourceId); $dirs = $policy->getAllowedDirectories(); foreach ($dirs as $dir=>$dummy) { if (strpos($resourceId, $dir) === 0) { break 2; } } throw new Dwoo_Security_Exception('The security policy prevents you to read <em>'.$resourceId.'</em>'); } } return new Dwoo_Template_File($resourceId, $cacheTime, $cacheId, $compileId, $includePath); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-')); } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } } class Dwoo_Data implements Dwoo_IDataProvider { protected $data = array(); public function getData() { return $this->data; } public function clear($name = null) { if ($name === null) { $this->data = array(); } elseif (is_array($name)) { foreach ($name as $index) unset($this->data[$index]); } else { unset($this->data[$name]); } } public function setData(array $data) { $this->data = $data; } public function mergeData(array $data) { $args = func_get_args(); while (list(,$v) = each($args)) { if (is_array($v)) { $this->data = array_merge($this->data, $v); } } } public function assign($name, $val = null) { if (is_array($name)) { reset($name); while (list($k,$v) = each($name)) $this->data[$k] = $v; } else { $this->data[$name] = $val; } } public function __set($name, $value) { $this->assign($name, $value); } public function assignByRef($name, &$val) { $this->data[$name] =& $val; } public function append($name, $val = null, $merge = false) { if (is_array($name)) { foreach ($name as $key=>$val) { if (isset($this->data[$key]) && !is_array($this->data[$key])) { settype($this->data[$key], 'array'); } if ($merge === true && is_array($val)) { $this->data[$key] = $val + $this->data[$key]; } else { $this->data[$key][] = $val; } } } elseif ($val !== null) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { $this->data[$name] = $val + $this->data[$name]; } else { $this->data[$name][] = $val; } } } public function appendByRef($name, &$val, $merge = false) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { foreach ($val as $key => &$val) { $this->data[$name][$key] =& $val; } } else { $this->data[$name][] =& $val; } } public function isAssigned($name) { return isset($this->data[$name]); } public function __isset($name) { return isset($this->data[$name]); } public function unassign($name) { unset($this->data[$name]); } public function __unset($name) { unset($this->data[$name]); } public function get($name) { return $this->__get($name); } public function __get($name) { if (isset($this->data[$name])) { return $this->data[$name]; } else { throw new Dwoo_Exception('Tried to read a value that was not assigned yet : "'.$name.'"'); } } }
9aa351 2fd2c9 a/lib/Dwoo.php
8 8 *
9 9 * <pre>
10 10 * requirements :
11 - * php 5.2.0 or above
11 + * php 5.2.0 or above (might work below, it's a rough estimate)
12 12 * SPL and PCRE extensions (for php versions prior to 5.3.0)
13 13 * mbstring extension for some string manipulation plugins (especially if you intend to use UTF-8)
14 14 * recommended :
21 21 * This software is provided 'as-is', without any express or implied warranty.
22 22 * In no event will the authors be held liable for any damages arising from the use of this software.
23 23 *
24 - * This file is released under the LGPL
25 - * "GNU Lesser General Public License"
26 - * More information can be found here:
27 - * {@link http://www.gnu.org/copyleft/lesser.html}
28 - *
29 24 * @author Jordi Boggiano <j.boggiano@seld.be>
30 25 * @copyright Copyright (c) 2008, Jordi Boggiano
31 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
26 + * @license http://dwoo.org/LICENSE Modified BSD License
32 27 * @link http://dwoo.org/
33 - * @version 0.9.2
34 - * @date 2008-06-28
28 + * @version 1.0.0
29 + * @date 2008-10-23
35 30 * @package Dwoo
36 31 */
37 32 class Dwoo
41 36 *
42 37 * @var string
43 38 */
44 - const VERSION = "1.0.0beta";
39 + const VERSION = '1.0.0';
45 40
46 41 /**
47 42 * unique number of this dwoo release
50 45 * has been compiled before this release or not, so that old templates are
51 46 * recompiled automatically when Dwoo is updated
52 47 */
53 - const RELEASE_TAG = 13;
48 + const RELEASE_TAG = 14;
54 49
55 50 /**#@+
56 51 * constants that represents all plugin types
9aa351 2fd2c9 a/lib/Dwoo/Adapters/Agavi/DwooRenderer.php
33 33 * In no event will the authors be held liable for any damages arising from the
34 34 * use of this software.
35 35 *
36 - * This file is released under the LGPL
37 - * "GNU Lesser General Public License"
38 - * More information can be found here:
39 - * {@link http://www.gnu.org/copyleft/lesser.html}
40 - *
41 36 * @author Jordi Boggiano <j.boggiano@seld.be>
42 37 * @copyright Copyright (c) 2008, Jordi Boggiano
43 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
38 + * @license http://dwoo.org/LICENSE Modified BSD License
44 39 * @link http://dwoo.org/
45 40 * @version 1.0.0
46 - * @date 2008-09-07
41 + * @date 2008-10-23
47 42 * @package Dwoo
48 43 */
49 44 class DwooRenderer extends AgaviRenderer implements AgaviIReusableRenderer
9aa351 2fd2c9 a/lib/Dwoo/Adapters/Agavi/dwoo_plugins/t.php
19 19 * This software is provided 'as-is', without any express or implied warranty.
20 20 * In no event will the authors be held liable for any damages arising from the use of this software.
21 21 *
22 - * This file is released under the LGPL
23 - * "GNU Lesser General Public License"
24 - * More information can be found here:
25 - * {@link http://www.gnu.org/copyleft/lesser.html}
26 - *
27 22 * @author Jordi Boggiano <j.boggiano@seld.be>
28 23 * @copyright Copyright (c) 2008, Jordi Boggiano
29 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
24 + * @license http://dwoo.org/LICENSE Modified BSD License
30 25 * @link http://dwoo.org/
31 26 * @version 1.0.0
32 - * @date 2008-09-08
27 + * @date 2008-10-23
33 28 * @package Dwoo
34 29 */
35 30 function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string)
9aa351 2fd2c9 a/lib/Dwoo/Adapters/Agavi/dwoo_plugins/url.php
23 23 * This software is provided 'as-is', without any express or implied warranty.
24 24 * In no event will the authors be held liable for any damages arising from the use of this software.
25 25 *
26 - * This file is released under the LGPL
27 - * "GNU Lesser General Public License"
28 - * More information can be found here:
29 - * {@link http://www.gnu.org/copyleft/lesser.html}
30 - *
31 26 * @author Jordi Boggiano <j.boggiano@seld.be>
32 27 * @copyright Copyright (c) 2008, Jordi Boggiano
33 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
28 + * @license http://dwoo.org/LICENSE Modified BSD License
34 29 * @link http://dwoo.org/
35 30 * @version 1.0.0
36 - * @date 2008-09-08
31 + * @date 2008-10-23
37 32 * @package Dwoo
38 33 */
39 34 function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array())
9aa351 2fd2c9 a/lib/Dwoo/Adapters/ZendFramework/PluginProxy.php
8 8 * In no event will the authors be held liable for any damages arising from the
9 9 * use of this software.
10 10 *
11 - * This file is released under the LGPL
12 - * "GNU Lesser General Public License"
13 - * More information can be found here:
14 - * {@link http://www.gnu.org/copyleft/lesser.html}
15 - *
16 11 * @author Denis Arh <denis@arh.cc>
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 16 * @version 1.0.0
22 - * @date 2008-08-17
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 class Dwoo_Adapters_ZendFramework_PluginProxy implements Dwoo_IPluginProxy
9aa351 2fd2c9 a/lib/Dwoo/Adapters/ZendFramework/View.php
8 8 * In no event will the authors be held liable for any damages arising from the
9 9 * use of this software.
10 10 *
11 - * This file is released under the LGPL
12 - * "GNU Lesser General Public License"
13 - * More information can be found here:
14 - * {@link http://www.gnu.org/copyleft/lesser.html}
15 - *
16 11 * @author Denis Arh <denis@arh.cc>
17 12 * @author Stephan Wentz <stephan@wentz.it>
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 17 * @version 1.0.0
23 - * @date 2008-08-17
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 class Dwoo_Adapters_ZendFramework_View extends Zend_View_Abstract
9aa351 2fd2c9 a/lib/Dwoo/Block/Plugin.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 abstract class Dwoo_Block_Plugin extends Dwoo_Plugin
9aa351 2fd2c9 a/lib/Dwoo/Compilation/Exception.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Compilation_Exception extends Dwoo_Exception
9aa351 2fd2c9 a/lib/Dwoo/Compiler.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 class Dwoo_Compiler implements Dwoo_ICompiler
9aa351 2fd2c9 a/lib/Dwoo/Data.php
8 8 * This software is provided 'as-is', without any express or implied warranty.
9 9 * In no event will the authors be held liable for any damages arising from the use of this software.
10 10 *
11 - * This file is released under the LGPL
12 - * "GNU Lesser General Public License"
13 - * More information can be found here:
14 - * {@link http://www.gnu.org/copyleft/lesser.html}
15 - *
16 11 * @author Jordi Boggiano <j.boggiano@seld.be>
17 12 * @copyright Copyright (c) 2008, Jordi Boggiano
18 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
13 + * @license http://dwoo.org/LICENSE Modified BSD License
19 14 * @link http://dwoo.org/
20 - * @version 0.9.1
21 - * @date 2008-05-30
15 + * @version 1.0.0
16 + * @date 2008-10-23
22 17 * @package Dwoo
23 18 */
24 19 class Dwoo_Data implements Dwoo_IDataProvider
9aa351 2fd2c9 a/lib/Dwoo/Exception.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Exception extends Exception
9aa351 2fd2c9 a/lib/Dwoo/Filter.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 abstract class Dwoo_Filter
9aa351 2fd2c9 a/lib/Dwoo/ICompilable.php
12 12 * This software is provided 'as-is', without any express or implied warranty.
13 13 * In no event will the authors be held liable for any damages arising from the use of this software.
14 14 *
15 - * This file is released under the LGPL
16 - * "GNU Lesser General Public License"
17 - * More information can be found here:
18 - * {@link http://www.gnu.org/copyleft/lesser.html}
19 - *
20 15 * @author Jordi Boggiano <j.boggiano@seld.be>
21 16 * @copyright Copyright (c) 2008, Jordi Boggiano
22 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
17 + * @license http://dwoo.org/LICENSE Modified BSD License
23 18 * @link http://dwoo.org/
24 - * @version 0.9.1
25 - * @date 2008-05-30
19 + * @version 1.0.0
20 + * @date 2008-10-23
26 21 * @package Dwoo
27 22 */
28 23 interface Dwoo_ICompilable
9aa351 2fd2c9 a/lib/Dwoo/ICompilable/Block.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 interface Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/Dwoo/ICompiler.php
12 12 * This software is provided 'as-is', without any express or implied warranty.
13 13 * In no event will the authors be held liable for any damages arising from the use of this software.
14 14 *
15 - * This file is released under the LGPL
16 - * "GNU Lesser General Public License"
17 - * More information can be found here:
18 - * {@link http://www.gnu.org/copyleft/lesser.html}
19 - *
20 15 * @author Jordi Boggiano <j.boggiano@seld.be>
21 16 * @copyright Copyright (c) 2008, Jordi Boggiano
22 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
17 + * @license http://dwoo.org/LICENSE Modified BSD License
23 18 * @link http://dwoo.org/
24 - * @version 0.9.1
25 - * @date 2008-05-30
19 + * @version 1.0.0
20 + * @date 2008-10-23
26 21 * @package Dwoo
27 22 */
28 23 interface Dwoo_ICompiler
9aa351 2fd2c9 a/lib/Dwoo/IDataProvider.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 interface Dwoo_IDataProvider
9aa351 2fd2c9 a/lib/Dwoo/IElseable.php
12 12 * This software is provided 'as-is', without any express or implied warranty.
13 13 * In no event will the authors be held liable for any damages arising from the use of this software.
14 14 *
15 - * This file is released under the LGPL
16 - * "GNU Lesser General Public License"
17 - * More information can be found here:
18 - * {@link http://www.gnu.org/copyleft/lesser.html}
19 - *
20 15 * @author Jordi Boggiano <j.boggiano@seld.be>
21 16 * @copyright Copyright (c) 2008, Jordi Boggiano
22 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
17 + * @license http://dwoo.org/LICENSE Modified BSD License
23 18 * @link http://dwoo.org/
24 - * @version 0.9.1
25 - * @date 2008-05-30
19 + * @version 1.0.0
20 + * @date 2008-10-23
26 21 * @package Dwoo
27 22 */
28 23 interface Dwoo_IElseable
9aa351 2fd2c9 a/lib/Dwoo/ILoader.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 interface Dwoo_ILoader
9aa351 2fd2c9 a/lib/Dwoo/IPluginProxy.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Denis Arh <denis@arh.cc>
16 11 * @author Jordi Boggiano <j.boggiano@seld.be>
17 12 * @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano
18 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
13 + * @license http://dwoo.org/LICENSE Modified BSD License
19 14 * @link http://dwoo.org/
20 - * @version 0.9.1
21 - * @date 2008-05-30
15 + * @version 1.0.0
16 + * @date 2008-10-23
22 17 * @package Dwoo
23 18 */
24 19 interface Dwoo_IPluginProxy
9aa351 2fd2c9 a/lib/Dwoo/ITemplate.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 interface Dwoo_ITemplate
9aa351 2fd2c9 a/lib/Dwoo/Loader.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Loader implements Dwoo_ILoader
9aa351 2fd2c9 a/lib/Dwoo/Plugin.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 abstract class Dwoo_Plugin
9aa351 2fd2c9 a/lib/Dwoo/Processor.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 abstract class Dwoo_Processor
9aa351 2fd2c9 a/lib/Dwoo/Security/Exception.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Security_Exception extends Dwoo_Exception
9aa351 2fd2c9 a/lib/Dwoo/Security/Policy.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Security_Policy
9aa351 2fd2c9 a/lib/Dwoo/Smarty/Adapter.php
22 22 * This software is provided 'as-is', without any express or implied warranty.
23 23 * In no event will the authors be held liable for any damages arising from the use of this software.
24 24 *
25 - * This file is released under the LGPL
26 - * "GNU Lesser General Public License"
27 - * More information can be found here:
28 - * {@link http://www.gnu.org/copyleft/lesser.html}
29 - *
30 25 * @author Jordi Boggiano <j.boggiano@seld.be>
31 26 * @copyright Copyright (c) 2008, Jordi Boggiano
32 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
27 + * @license http://dwoo.org/LICENSE Modified BSD License
33 28 * @link http://dwoo.org/
34 - * @version 0.9.1
35 - * @date 2008-05-30
29 + * @version 1.0.0
30 + * @date 2008-10-23
36 31 * @package Dwoo
37 32 */
38 33 class Dwoo_Smarty__Adapter extends Dwoo
9aa351 2fd2c9 a/lib/Dwoo/Template/File.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Template_File extends Dwoo_Template_String
9aa351 2fd2c9 a/lib/Dwoo/Template/String.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Template_String implements Dwoo_ITemplate
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/a.php
25 25 * This software is provided 'as-is', without any express or implied warranty.
26 26 * In no event will the authors be held liable for any damages arising from the use of this software.
27 27 *
28 - * This file is released under the LGPL
29 - * "GNU Lesser General Public License"
30 - * More information can be found here:
31 - * {@link http://www.gnu.org/copyleft/lesser.html}
32 - *
33 28 * @author Jordi Boggiano <j.boggiano@seld.be>
34 29 * @copyright Copyright (c) 2008, Jordi Boggiano
35 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
30 + * @license http://dwoo.org/LICENSE Modified BSD License
36 31 * @link http://dwoo.org/
37 - * @version 0.9.1
38 - * @date 2008-05-30
32 + * @version 1.0.0
33 + * @date 2008-10-23
39 34 * @package Dwoo
40 35 */
41 36 class Dwoo_Plugin_a extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/auto_escape.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 class Dwoo_Plugin_auto_escape extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/block.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 class Dwoo_Plugin_block extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/capture.php
24 24 * This software is provided 'as-is', without any express or implied warranty.
25 25 * In no event will the authors be held liable for any damages arising from the use of this software.
26 26 *
27 - * This file is released under the LGPL
28 - * "GNU Lesser General Public License"
29 - * More information can be found here:
30 - * {@link http://www.gnu.org/copyleft/lesser.html}
31 - *
32 27 * @author Jordi Boggiano <j.boggiano@seld.be>
33 28 * @copyright Copyright (c) 2008, Jordi Boggiano
34 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
29 + * @license http://dwoo.org/LICENSE Modified BSD License
35 30 * @link http://dwoo.org/
36 - * @version 0.9.1
37 - * @date 2008-05-30
31 + * @version 1.0.0
32 + * @date 2008-10-23
38 33 * @package Dwoo
39 34 */
40 35 class Dwoo_Plugin_capture extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/dynamic.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/else.php
20 20 * This software is provided 'as-is', without any express or implied warranty.
21 21 * In no event will the authors be held liable for any damages arising from the use of this software.
22 22 *
23 - * This file is released under the LGPL
24 - * "GNU Lesser General Public License"
25 - * More information can be found here:
26 - * {@link http://www.gnu.org/copyleft/lesser.html}
27 - *
28 23 * @author Jordi Boggiano <j.boggiano@seld.be>
29 24 * @copyright Copyright (c) 2008, Jordi Boggiano
30 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
25 + * @license http://dwoo.org/LICENSE Modified BSD License
31 26 * @link http://dwoo.org/
32 - * @version 0.9.1
33 - * @date 2008-05-30
27 + * @version 1.0.0
28 + * @date 2008-10-23
34 29 * @package Dwoo
35 30 */
36 31 class Dwoo_Plugin_else extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/elseif.php
8 8 * This software is provided 'as-is', without any express or implied warranty.
9 9 * In no event will the authors be held liable for any damages arising from the use of this software.
10 10 *
11 - * This file is released under the LGPL
12 - * "GNU Lesser General Public License"
13 - * More information can be found here:
14 - * {@link http://www.gnu.org/copyleft/lesser.html}
15 - *
16 11 * @author Jordi Boggiano <j.boggiano@seld.be>
17 12 * @copyright Copyright (c) 2008, Jordi Boggiano
18 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
13 + * @license http://dwoo.org/LICENSE Modified BSD License
19 14 * @link http://dwoo.org/
20 - * @version 0.9.1
21 - * @date 2008-05-30
15 + * @version 1.0.0
16 + * @date 2008-10-23
22 17 * @package Dwoo
23 18 */
24 19 class Dwoo_Plugin_elseif extends Dwoo_Plugin_if implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/for.php
12 12 * This software is provided 'as-is', without any express or implied warranty.
13 13 * In no event will the authors be held liable for any damages arising from the use of this software.
14 14 *
15 - * This file is released under the LGPL
16 - * "GNU Lesser General Public License"
17 - * More information can be found here:
18 - * {@link http://www.gnu.org/copyleft/lesser.html}
19 - *
20 15 * @author Jordi Boggiano <j.boggiano@seld.be>
21 16 * @copyright Copyright (c) 2008, Jordi Boggiano
22 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
17 + * @license http://dwoo.org/LICENSE Modified BSD License
23 18 * @link http://dwoo.org/
24 - * @version 0.9.1
25 - * @date 2008-05-30
19 + * @version 1.0.0
20 + * @date 2008-10-23
26 21 * @package Dwoo
27 22 */
28 23 class Dwoo_Plugin_for extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/foreach.php
22 22 * This software is provided 'as-is', without any express or implied warranty.
23 23 * In no event will the authors be held liable for any damages arising from the use of this software.
24 24 *
25 - * This file is released under the LGPL
26 - * "GNU Lesser General Public License"
27 - * More information can be found here:
28 - * {@link http://www.gnu.org/copyleft/lesser.html}
29 - *
30 25 * @author Jordi Boggiano <j.boggiano@seld.be>
31 26 * @copyright Copyright (c) 2008, Jordi Boggiano
32 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
27 + * @license http://dwoo.org/LICENSE Modified BSD License
33 28 * @link http://dwoo.org/
34 - * @version 0.9.1
35 - * @date 2008-05-30
29 + * @version 1.0.0
30 + * @date 2008-10-23
36 31 * @package Dwoo
37 32 */
38 33 class Dwoo_Plugin_foreach extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/foreachelse.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_foreachelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/forelse.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_forelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/if.php
20 20 * This software is provided 'as-is', without any express or implied warranty.
21 21 * In no event will the authors be held liable for any damages arising from the use of this software.
22 22 *
23 - * This file is released under the LGPL
24 - * "GNU Lesser General Public License"
25 - * More information can be found here:
26 - * {@link http://www.gnu.org/copyleft/lesser.html}
27 - *
28 23 * @author Jordi Boggiano <j.boggiano@seld.be>
29 24 * @copyright Copyright (c) 2008, Jordi Boggiano
30 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
25 + * @license http://dwoo.org/LICENSE Modified BSD License
31 26 * @link http://dwoo.org/
32 - * @version 0.9.1
33 - * @date 2008-05-30
27 + * @version 1.0.0
28 + * @date 2008-10-23
34 29 * @package Dwoo
35 30 */
36 31 class Dwoo_Plugin_if extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/loop.php
31 31 * This software is provided 'as-is', without any express or implied warranty.
32 32 * In no event will the authors be held liable for any damages arising from the use of this software.
33 33 *
34 - * This file is released under the LGPL
35 - * "GNU Lesser General Public License"
36 - * More information can be found here:
37 - * {@link http://www.gnu.org/copyleft/lesser.html}
38 - *
39 34 * @author Jordi Boggiano <j.boggiano@seld.be>
40 35 * @copyright Copyright (c) 2008, Jordi Boggiano
41 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
36 + * @license http://dwoo.org/LICENSE Modified BSD License
42 37 * @link http://dwoo.org/
43 - * @version 0.9.1
44 - * @date 2008-05-30
38 + * @version 1.0.0
39 + * @date 2008-10-23
45 40 * @package Dwoo
46 41 */
47 42 class Dwoo_Plugin_loop extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/section.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_section extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/smartyinterface.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_smartyinterface extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/strip.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 class Dwoo_Plugin_strip extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/textformat.php
17 17 * This software is provided 'as-is', without any express or implied warranty.
18 18 * In no event will the authors be held liable for any damages arising from the use of this software.
19 19 *
20 - * This file is released under the LGPL
21 - * "GNU Lesser General Public License"
22 - * More information can be found here:
23 - * {@link http://www.gnu.org/copyleft/lesser.html}
24 - *
25 20 * @author Jordi Boggiano <j.boggiano@seld.be>
26 21 * @copyright Copyright (c) 2008, Jordi Boggiano
27 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
22 + * @license http://dwoo.org/LICENSE Modified BSD License
28 23 * @link http://dwoo.org/
29 - * @version 0.9.1
30 - * @date 2008-05-30
24 + * @version 1.0.0
25 + * @date 2008-10-23
31 26 * @package Dwoo
32 27 */
33 28 class Dwoo_Plugin_textformat extends Dwoo_Block_Plugin
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/topLevelBlock.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 final class Dwoo_Plugin_topLevelBlock extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/with.php
31 31 * This software is provided 'as-is', without any express or implied warranty.
32 32 * In no event will the authors be held liable for any damages arising from the use of this software.
33 33 *
34 - * This file is released under the LGPL
35 - * "GNU Lesser General Public License"
36 - * More information can be found here:
37 - * {@link http://www.gnu.org/copyleft/lesser.html}
38 - *
39 34 * @author Jordi Boggiano <j.boggiano@seld.be>
40 35 * @copyright Copyright (c) 2008, Jordi Boggiano
41 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
36 + * @license http://dwoo.org/LICENSE Modified BSD License
42 37 * @link http://dwoo.org/
43 - * @version 0.9.1
44 - * @date 2008-05-30
38 + * @version 1.0.0
39 + * @date 2008-10-23
45 40 * @package Dwoo
46 41 */
47 42 class Dwoo_Plugin_with extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable
9aa351 2fd2c9 a/lib/plugins/builtin/blocks/withelse.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 class Dwoo_Plugin_withelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block
9aa351 2fd2c9 a/lib/plugins/builtin/filters/html_format.php
13 13 * This software is provided 'as-is', without any express or implied warranty.
14 14 * In no event will the authors be held liable for any damages arising from the use of this software.
15 15 *
16 - * This file is released under the LGPL
17 - * "GNU Lesser General Public License"
18 - * More information can be found here:
19 - * {@link http://www.gnu.org/copyleft/lesser.html}
20 - *
21 16 * @author Jordi Boggiano <j.boggiano@seld.be>
22 17 * @copyright Copyright (c) 2008, Jordi Boggiano
23 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
18 + * @license http://dwoo.org/LICENSE Modified BSD License
24 19 * @link http://dwoo.org/
25 - * @version 0.9.1
26 - * @date 2008-05-30
20 + * @version 1.0.0
21 + * @date 2008-10-23
27 22 * @package Dwoo
28 23 */
29 24 class Dwoo_Filter_html_format extends Dwoo_Filter
9aa351 2fd2c9 a/lib/plugins/builtin/functions/assign.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_assign_compile(Dwoo_Compiler $compiler, $value, $var)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/capitalize.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_capitalize(Dwoo $dwoo, $value, $numwords=false)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/cat.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_cat_compile(Dwoo_Compiler $compiler, $value, array $rest)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/count_characters.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_count_characters_compile(Dwoo_Compiler $compiler, $value, $count_spaces=false)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/count_paragraphs.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_count_paragraphs_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/count_sentences.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_count_sentences_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/count_words.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_count_words_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/counter.php
14 14 * This software is provided 'as-is', without any express or implied warranty.
15 15 * In no event will the authors be held liable for any damages arising from the use of this software.
16 16 *
17 - * This file is released under the LGPL
18 - * "GNU Lesser General Public License"
19 - * More information can be found here:
20 - * {@link http://www.gnu.org/copyleft/lesser.html}
21 - *
22 17 * @author Jordi Boggiano <j.boggiano@seld.be>
23 18 * @copyright Copyright (c) 2008, Jordi Boggiano
24 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
19 + * @license http://dwoo.org/LICENSE Modified BSD License
25 20 * @link http://dwoo.org/
26 - * @version 0.9.1
27 - * @date 2008-05-30
21 + * @version 1.0.0
22 + * @date 2008-10-23
28 23 * @package Dwoo
29 24 */
30 25 class Dwoo_Plugin_counter extends Dwoo_Plugin
9aa351 2fd2c9 a/lib/plugins/builtin/functions/cycle.php
15 15 * This software is provided 'as-is', without any express or implied warranty.
16 16 * In no event will the authors be held liable for any damages arising from the use of this software.
17 17 *
18 - * This file is released under the LGPL
19 - * "GNU Lesser General Public License"
20 - * More information can be found here:
21 - * {@link http://www.gnu.org/copyleft/lesser.html}
22 - *
23 18 * @author Jordi Boggiano <j.boggiano@seld.be>
24 19 * @copyright Copyright (c) 2008, Jordi Boggiano
25 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
20 + * @license http://dwoo.org/LICENSE Modified BSD License
26 21 * @link http://dwoo.org/
27 - * @version 0.9.1
28 - * @date 2008-05-30
22 + * @version 1.0.0
23 + * @date 2008-10-23
29 24 * @package Dwoo
30 25 */
31 26 class Dwoo_Plugin_cycle extends Dwoo_Plugin
9aa351 2fd2c9 a/lib/plugins/builtin/functions/date_format.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_date_format(Dwoo $dwoo, $value, $format='%b %e, %Y', $default=null)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/default.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_default_compile(Dwoo_Compiler $compiler, $value, $default='')
9aa351 2fd2c9 a/lib/plugins/builtin/functions/dump.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 class Dwoo_Plugin_dump extends Dwoo_Plugin
9aa351 2fd2c9 a/lib/plugins/builtin/functions/eol.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 function Dwoo_Plugin_eol_compile(Dwoo_Compiler $compiler)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/escape.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_escape(Dwoo $dwoo, $value='', $format='html', $charset=null)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/eval.php
17 17 * This software is provided 'as-is', without any express or implied warranty.
18 18 * In no event will the authors be held liable for any damages arising from the use of this software.
19 19 *
20 - * This file is released under the LGPL
21 - * "GNU Lesser General Public License"
22 - * More information can be found here:
23 - * {@link http://www.gnu.org/copyleft/lesser.html}
24 - *
25 20 * @author Jordi Boggiano <j.boggiano@seld.be>
26 21 * @copyright Copyright (c) 2008, Jordi Boggiano
27 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
22 + * @license http://dwoo.org/LICENSE Modified BSD License
28 23 * @link http://dwoo.org/
29 - * @version 0.9.1
30 - * @date 2008-05-30
24 + * @version 1.0.0
25 + * @date 2008-10-23
31 26 * @package Dwoo
32 27 */
33 28 function Dwoo_Plugin_eval(Dwoo $dwoo, $var, $assign = null)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/extends.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
9aa351 2fd2c9 a/lib/plugins/builtin/functions/extendsCheck.php
7 7 * This software is provided 'as-is', without any express or implied warranty.
8 8 * In no event will the authors be held liable for any damages arising from the use of this software.
9 9 *
10 - * This file is released under the LGPL
11 - * "GNU Lesser General Public License"
12 - * More information can be found here:
13 - * {@link http://www.gnu.org/copyleft/lesser.html}
14 - *
15 10 * @author Jordi Boggiano <j.boggiano@seld.be>
16 11 * @copyright Copyright (c) 2008, Jordi Boggiano
17 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
12 + * @license http://dwoo.org/LICENSE Modified BSD License
18 13 * @link http://dwoo.org/
19 - * @version 0.9.1
20 - * @date 2008-05-30
14 + * @version 1.0.0
15 + * @date 2008-10-23
21 16 * @package Dwoo
22 17 */
23 18 function Dwoo_Plugin_extendsCheck_compile(Dwoo_Compiler $compiler, $file, $uid)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/fetch.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_fetch(Dwoo $dwoo, $file, $assign = null)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/include.php
15 15 * This software is provided 'as-is', without any express or implied warranty.
16 16 * In no event will the authors be held liable for any damages arising from the use of this software.
17 17 *
18 - * This file is released under the LGPL
19 - * "GNU Lesser General Public License"
20 - * More information can be found here:
21 - * {@link http://www.gnu.org/copyleft/lesser.html}
22 - *
23 18 * @author Jordi Boggiano <j.boggiano@seld.be>
24 19 * @copyright Copyright (c) 2008, Jordi Boggiano
25 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
20 + * @license http://dwoo.org/LICENSE Modified BSD License
26 21 * @link http://dwoo.org/
27 - * @version 0.9.1
28 - * @date 2008-05-30
22 + * @version 1.0.0
23 + * @date 2008-10-23
29 24 * @package Dwoo
30 25 */
31 26 function Dwoo_Plugin_include(Dwoo $dwoo, $file, $cache_time = null, $cache_id = null, $compile_id = null, $data = '_root', $assign = null, array $rest = array())
9aa351 2fd2c9 a/lib/plugins/builtin/functions/indent.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_indent_compile(Dwoo_Compiler $compiler, $value, $by=4, $char=' ')
9aa351 2fd2c9 a/lib/plugins/builtin/functions/isset.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_isset_compile(Dwoo_Compiler $compiler, $var)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/lower.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_lower_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/mailto.php
17 17 * This software is provided 'as-is', without any express or implied warranty.
18 18 * In no event will the authors be held liable for any damages arising from the use of this software.
19 19 *
20 - * This file is released under the LGPL
21 - * "GNU Lesser General Public License"
22 - * More information can be found here:
23 - * {@link http://www.gnu.org/copyleft/lesser.html}
24 - *
25 20 * @author Jordi Boggiano <j.boggiano@seld.be>
26 21 * @copyright Copyright (c) 2008, Jordi Boggiano
27 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
22 + * @license http://dwoo.org/LICENSE Modified BSD License
28 23 * @link http://dwoo.org/
29 - * @version 0.9.1
30 - * @date 2008-05-30
24 + * @version 1.0.0
25 + * @date 2008-10-23
31 26 * @package Dwoo
32 27 */
33 28 function Dwoo_Plugin_mailto(Dwoo $dwoo, $address, $text=null, $subject=null, $encode=null, $cc=null, $bcc=null, $newsgroups=null, $followupto=null, $extra=null)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/math.php
21 21 * This software is provided 'as-is', without any express or implied warranty.
22 22 * In no event will the authors be held liable for any damages arising from the use of this software.
23 23 *
24 - * This file is released under the LGPL
25 - * "GNU Lesser General Public License"
26 - * More information can be found here:
27 - * {@link http://www.gnu.org/copyleft/lesser.html}
28 - *
29 24 * @author Jordi Boggiano <j.boggiano@seld.be>
30 25 * @copyright Copyright (c) 2008, Jordi Boggiano
31 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
26 + * @license http://dwoo.org/LICENSE Modified BSD License
32 27 * @link http://dwoo.org/
33 - * @version 0.9.1
34 - * @date 2008-05-30
28 + * @version 1.0.0
29 + * @date 2008-10-23
35 30 * @package Dwoo
36 31 */
37 32 function Dwoo_Plugin_math_compile(Dwoo_Compiler $compiler, $equation, $format='', $assign='', array $rest=array())
9aa351 2fd2c9 a/lib/plugins/builtin/functions/nl2br.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_nl2br_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/regex_replace.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_regex_replace(Dwoo $dwoo, $value, $search, $replace)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/replace.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_replace_compile(Dwoo_Compiler $compiler, $value, $search, $replace, $case_sensitive = true)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/reverse.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_reverse(Dwoo $dwoo, $value, $preserve_keys=false)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/safe.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_safe_compile(Dwoo_Compiler $compiler, $var)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/spacify.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_spacify_compile(Dwoo_Compiler $compiler, $value, $space_char=' ')
9aa351 2fd2c9 a/lib/plugins/builtin/functions/string_format.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_string_format_compile(Dwoo_Compiler $compiler, $value, $format)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/strip_tags.php
10 10 * This software is provided 'as-is', without any express or implied warranty.
11 11 * In no event will the authors be held liable for any damages arising from the use of this software.
12 12 *
13 - * This file is released under the LGPL
14 - * "GNU Lesser General Public License"
15 - * More information can be found here:
16 - * {@link http://www.gnu.org/copyleft/lesser.html}
17 - *
18 13 * @author Jordi Boggiano <j.boggiano@seld.be>
19 14 * @copyright Copyright (c) 2008, Jordi Boggiano
20 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 + * @license http://dwoo.org/LICENSE Modified BSD License
21 16 * @link http://dwoo.org/
22 - * @version 0.9.1
23 - * @date 2008-05-30
17 + * @version 1.0.0
18 + * @date 2008-10-23
24 19 * @package Dwoo
25 20 */
26 21 function Dwoo_Plugin_strip_tags_compile(Dwoo_Compiler $compiler, $value, $addspace=true)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/tif.php
11 11 * This software is provided 'as-is', without any express or implied warranty.
12 12 * In no event will the authors be held liable for any damages arising from the use of this software.
13 13 *
14 - * This file is released under the LGPL
15 - * "GNU Lesser General Public License"
16 - * More information can be found here:
17 - * {@link http://www.gnu.org/copyleft/lesser.html}
18 - *
19 14 * @author Jordi Boggiano <j.boggiano@seld.be>
20 15 * @copyright Copyright (c) 2008, Jordi Boggiano
21 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16 + * @license http://dwoo.org/LICENSE Modified BSD License
22 17 * @link http://dwoo.org/
23 - * @version 0.9.1
24 - * @date 2008-05-30
18 + * @version 1.0.0
19 + * @date 2008-10-23
25 20 * @package Dwoo
26 21 */
27 22 function Dwoo_Plugin_tif_compile(Dwoo_Compiler $compiler, array $rest)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/truncate.php
13 13 * This software is provided 'as-is', without any express or implied warranty.
14 14 * In no event will the authors be held liable for any damages arising from the use of this software.
15 15 *
16 - * This file is released under the LGPL
17 - * "GNU Lesser General Public License"
18 - * More information can be found here:
19 - * {@link http://www.gnu.org/copyleft/lesser.html}
20 - *
21 16 * @author Jordi Boggiano <j.boggiano@seld.be>
22 17 * @copyright Copyright (c) 2008, Jordi Boggiano
23 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
18 + * @license http://dwoo.org/LICENSE Modified BSD License
24 19 * @link http://dwoo.org/
25 - * @version 0.9.1
26 - * @date 2008-05-30
20 + * @version 1.0.0
21 + * @date 2008-10-23
27 22 * @package Dwoo
28 23 */
29 24 function Dwoo_Plugin_truncate(Dwoo $dwoo, $value, $length=80, $etc='...', $break=false, $middle=false)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/upper.php
9 9 * This software is provided 'as-is', without any express or implied warranty.
10 10 * In no event will the authors be held liable for any damages arising from the use of this software.
11 11 *
12 - * This file is released under the LGPL
13 - * "GNU Lesser General Public License"
14 - * More information can be found here:
15 - * {@link http://www.gnu.org/copyleft/lesser.html}
16 - *
17 12 * @author Jordi Boggiano <j.boggiano@seld.be>
18 13 * @copyright Copyright (c) 2008, Jordi Boggiano
19 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
14 + * @license http://dwoo.org/LICENSE Modified BSD License
20 15 * @link http://dwoo.org/
21 - * @version 0.9.1
22 - * @date 2008-05-30
16 + * @version 1.0.0
17 + * @date 2008-10-23
23 18 * @package Dwoo
24 19 */
25 20 function Dwoo_Plugin_upper_compile(Dwoo_Compiler $compiler, $value)
9aa351 2fd2c9 a/lib/plugins/builtin/functions/whitespace.php
20 20 * This software is provided 'as-is', without any express or implied warranty.
21 21 * In no event will the authors be held liable for any damages arising from the use of this software.
22 22 *
23 - * This file is released under the LGPL
24 - * "GNU Lesser General Public License"
25 - * More information can be found here:
26 - * {@link http://www.gnu.org/copyleft/lesser.html}
27 - *
28 23 * @author Jordi Boggiano <j.boggiano@seld.be>
29 24 * @copyright Copyright (c) 2008, Jordi Boggiano
30 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
25 + * @license http://dwoo.org/LICENSE Modified BSD License
31 26 * @link http://dwoo.org/
32 - * @version 0.9.1
33 - * @date 2008-05-30
27 + * @version 1.0.0
28 + * @date 2008-10-23
34 29 * @package Dwoo
35 30 */
36 31 function Dwoo_Plugin_whitespace_compile(Dwoo_Compiler $compiler, $value, $with=' ')
9aa351 2fd2c9 a/lib/plugins/builtin/functions/wordwrap.php
12 12 * This software is provided 'as-is', without any express or implied warranty.
13 13 * In no event will the authors be held liable for any damages arising from the use of this software.
14 14 *
15 - * This file is released under the LGPL
16 - * "GNU Lesser General Public License"
17 - * More information can be found here:
18 - * {@link http://www.gnu.org/copyleft/lesser.html}
19 - *
20 15 * @author Jordi Boggiano <j.boggiano@seld.be>
21 16 * @copyright Copyright (c) 2008, Jordi Boggiano
22 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
17 + * @license http://dwoo.org/LICENSE Modified BSD License
23 18 * @link http://dwoo.org/
24 - * @version 0.9.1
25 - * @date 2008-05-30
19 + * @version 1.0.0
20 + * @date 2008-10-23
26 21 * @package Dwoo
27 22 */
28 23 function Dwoo_Plugin_wordwrap_compile(Dwoo_Compiler $compiler, $value, $length=80, $break="\n", $cut=false)
9aa351 2fd2c9 a/lib/plugins/builtin/helper.array.php
16 16 * This software is provided 'as-is', without any express or implied warranty.
17 17 * In no event will the authors be held liable for any damages arising from the use of this software.
18 18 *
19 - * This file is released under the LGPL
20 - * "GNU Lesser General Public License"
21 - * More information can be found here:
22 - * {@link http://www.gnu.org/copyleft/lesser.html}
23 - *
24 19 * @author Jordi Boggiano <j.boggiano@seld.be>
25 20 * @copyright Copyright (c) 2008, Jordi Boggiano
26 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
21 + * @license http://dwoo.org/LICENSE Modified BSD License
27 22 * @link http://dwoo.org/
28 - * @version 0.9.1
29 - * @date 2008-05-30
23 + * @version 1.0.0
24 + * @date 2008-10-23
30 25 * @package Dwoo
31 26 */
32 27 function Dwoo_Plugin_array_compile(Dwoo_Compiler $compiler, array $rest=array())
9aa351 2fd2c9 a/lib/plugins/builtin/processors/pre.smarty_compat.php
8 8 * This software is provided 'as-is', without any express or implied warranty.
9 9 * In no event will the authors be held liable for any damages arising from the use of this software.
10 10 *
11 - * This file is released under the LGPL
12 - * "GNU Lesser General Public License"
13 - * More information can be found here:
14 - * {@link http://www.gnu.org/copyleft/lesser.html}
15 - *
16 11 * @author Jordi Boggiano <j.boggiano@seld.be>
17 12 * @copyright Copyright (c) 2008, Jordi Boggiano
18 - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
13 + * @license http://dwoo.org/LICENSE Modified BSD License
19 14 * @link http://dwoo.org/
20 - * @version 0.9.1
21 - * @date 2008-05-30
15 + * @version 1.0.0
16 + * @date 2008-10-23
22 17 * @package Dwoo
23 18 */
24 19 class Dwoo_Processor_smarty_compat extends Dwoo_Processor