Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
454339d0
Commit
454339d0
authored
Nov 25, 2009
by
seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #43
Fixes a {load_templates} bug, plugins used in external templates were not loaded correctly git-svn-id:
http://svn.dwoo.org/trunk@315
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
cf4be68f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
CHANGELOG
CHANGELOG
+2
-0
Compiler.php
lib/Dwoo/Compiler.php
+28
-2
load_templates.php
lib/plugins/builtin/functions/load_templates.php
+3
-0
No files found.
CHANGELOG
View file @
454339d0
...
...
@@ -28,6 +28,8 @@
*
Fixed
a
bug
when
accessing
global
vars
from
a
sub
-
template
*
Fixed
a
couple
bugs
in
the
{
dynamic
}
plugin
with
regard
to
using
plugins
within
a
dynamic
block
*
Fixed
a
{
load_templates
}
bug
,
plugins
used
in
external
templates
were
not
loaded
correctly
*
Cached
templates
now
check
the
source
template
for
modification
before
outputting
the
cached
version
*
Removed
a
couple
of
@-
operator
calls
to
file_get_contents
...
...
lib/Dwoo/Compiler.php
View file @
454339d0
...
...
@@ -471,7 +471,33 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
/**
* adds a template plugin, this is reserved for use by the {function} plugin
* adds an used plugin, this is reserved for use by the {template} plugin
*
* this is required so that plugin loading bubbles up from loaded
* template files to the current one
*
* @private
* @param string $name function name
* @param int $type plugin type (Dwoo::*_PLUGIN)
*/
public
function
addUsedPlugin
(
$name
,
$type
)
{
$this
->
usedPlugins
[
$name
]
=
$type
;
}
/**
* returns all the plugins this template uses
*
* @private
* @return array the list of used plugins in the parsed template
*/
public
function
getUsedPlugins
()
{
return
$this
->
usedPlugins
;
}
/**
* adds a template plugin, this is reserved for use by the {template} plugin
*
* this is required because the template functions are not declared yet
* during compilation, so we must have a way of validating their argument
...
...
@@ -2892,7 +2918,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
if
((
$pluginType
&
Dwoo
::
COMPILABLE_PLUGIN
)
===
0
&&
(
$pluginType
&
Dwoo
::
NATIVE_PLUGIN
)
===
0
&&
(
$pluginType
&
Dwoo
::
PROXY_PLUGIN
)
===
0
)
{
$this
->
usedPlugins
[
$name
]
=
$pluginType
;
$this
->
addUsedPlugin
(
$name
,
$pluginType
)
;
}
return
$pluginType
;
...
...
lib/plugins/builtin/functions/load_templates.php
View file @
454339d0
...
...
@@ -47,6 +47,9 @@ function Dwoo_Plugin_load_templates_compile(Dwoo_Compiler $compiler, $file)
foreach
(
$cmp
->
getTemplatePlugins
()
as
$template
=>
$args
)
{
$compiler
->
addTemplatePlugin
(
$template
,
$args
[
'params'
],
$args
[
'uuid'
],
$args
[
'body'
]);
}
foreach
(
$cmp
->
getUsedPlugins
()
as
$plugin
=>
$type
)
{
$compiler
->
addUsedPlugin
(
$plugin
,
$type
);
}
$out
=
'\'\';// checking for modification in '
.
$resource
.
':'
.
$identifier
.
"
\r\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment