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
eee94489
Commit
eee94489
authored
Nov 22, 2009
by
seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging r309-311 from 1.1
git-svn-id:
http://svn.dwoo.org/trunk@312
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
d3270dde
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
CHANGELOG
CHANGELOG
+3
-0
Dwoo.php
lib/Dwoo.php
+1
-2
String.php
lib/Dwoo/Template/String.php
+1
-1
dynamic.php
lib/plugins/builtin/blocks/dynamic.php
+7
-7
No files found.
CHANGELOG
View file @
eee94489
...
...
@@ -26,6 +26,9 @@
* Fixed a Dwoo_Data bug in the append method when the index didn'
t
exist
yet
it
threw
a
notice
*
Fixed
a
bug
when
accessing
global
vars
from
a
sub
-
template
*
Fixed
a
bug
in
the
{
dynamic
}
plugin
*
Cached
templates
now
check
the
source
template
for
modification
before
outputting
the
cached
version
*
Removed
a
couple
of
@-
operator
calls
to
file_get_contents
[
2009
-
07
-
18
]
1.1.0
...
...
lib/Dwoo.php
View file @
eee94489
...
...
@@ -408,9 +408,8 @@ class Dwoo
// output
if
(
$_output
===
true
)
{
echo
$out
;
}
else
{
return
$out
;
}
return
$out
;
}
}
}
...
...
lib/Dwoo/Template/String.php
View file @
eee94489
...
...
@@ -263,7 +263,7 @@ class Dwoo_Template_String implements Dwoo_ITemplate
if
(
isset
(
self
::
$cache
[
'cached'
][
$this
->
cacheId
])
===
true
&&
file_exists
(
$cachedFile
))
{
// already checked, return cache file
return
$cachedFile
;
}
elseif
(
$this
->
compilationEnforced
!==
true
&&
file_exists
(
$cachedFile
)
&&
(
$cacheLength
===
-
1
||
filemtime
(
$cachedFile
)
>
(
$_SERVER
[
'REQUEST_TIME'
]
-
$cacheLength
)))
{
}
elseif
(
$this
->
compilationEnforced
!==
true
&&
file_exists
(
$cachedFile
)
&&
(
$cacheLength
===
-
1
||
filemtime
(
$cachedFile
)
>
(
$_SERVER
[
'REQUEST_TIME'
]
-
$cacheLength
))
&&
$this
->
isValidCompiledFile
(
$this
->
getCompiledFilename
(
$dwoo
))
)
{
// cache is still valid and can be loaded
self
::
$cache
[
'cached'
][
$this
->
cacheId
]
=
true
;
return
$cachedFile
;
...
...
lib/plugins/builtin/blocks/dynamic.php
View file @
eee94489
...
...
@@ -27,9 +27,9 @@ class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_
public
static
function
postProcessing
(
Dwoo_Compiler
$compiler
,
array
$params
,
$prepend
,
$append
,
$content
)
{
$output
=
Dwoo_Compiler
::
PHP_OPEN
.
$output
=
Dwoo_Compiler
::
PHP_OPEN
.
'if($doCache) {'
.
"
\n\t
"
.
'echo \'<dwoo:dynamic_\'.$dynamicId.\'>'
.
'echo \'<dwoo:dynamic_\'.$dynamicId.\'>'
.
str_replace
(
'\''
,
'\\\''
,
$content
)
.
'</dwoo:dynamic_\'.$dynamicId.\'>\';'
.
"
\n
} else {\n
\t
"
;
...
...
@@ -42,19 +42,19 @@ class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_
$output
=
substr
(
$output
,
0
,
-
strlen
(
Dwoo_Compiler
::
PHP_CLOSE
));
}
else
{
$output
.=
Dwoo_Compiler
::
PHP_OPEN
;
}
}
$output
.=
"
\n
}"
.
Dwoo_Compiler
::
PHP_CLOSE
;
return
$output
;
}
public
static
function
unescape
(
$output
,
$dynamicId
)
{
return
preg_replace_callback
(
'/<dwoo:dynamic_('
.
$dynamicId
.
')>(.+?)<\/dwoo:dynamic_'
.
$dynamicId
.
'>/'
,
array
(
'self'
,
'unescapePhp'
),
$output
);
return
preg_replace_callback
(
'/<dwoo:dynamic_('
.
$dynamicId
.
')>(.+?)<\/dwoo:dynamic_'
.
$dynamicId
.
'>/
s
'
,
array
(
'self'
,
'unescapePhp'
),
$output
);
}
public
static
function
unescapePhp
(
$match
)
{
return
preg_replace
(
'{<\?php /\*'
.
$match
[
1
]
.
'\*/ echo \'(.+?)\'; \?>}'
,
'$1'
,
$match
[
2
]);
return
preg_replace
(
'{<\?php /\*'
.
$match
[
1
]
.
'\*/ echo \'(.+?)\'; \?>}
s
'
,
'$1'
,
$match
[
2
]);
}
}
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