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
ce2fb905
Commit
ce2fb905
authored
Jul 08, 2009
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No more double-slashes in template paths since this seemed to cause slight performance issues
git-svn-id:
svn://dwoo.org/dwoo/trunk@268
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
dd288f0c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
CHANGELOG
CHANGELOG
+2
-0
Loader.php
lib/Dwoo/Loader.php
+2
-2
File.php
lib/Dwoo/Template/File.php
+1
-2
String.php
lib/Dwoo/Template/String.php
+1
-1
No files found.
CHANGELOG
View file @
ce2fb905
...
...
@@ -30,6 +30,8 @@
* For can now iterate backwards if you input numbers, it won'
t
work
with
variables
though
*
Slight
performance
improvement
with
big
inheritance
trees
*
No
more
double
-
slashes
in
template
paths
since
this
seemed
to
cause
slight
performance
issues
*
Fixed
a
bug
with
parsing
AND
/
OR
keywords
in
conditionals
when
they
were
followed
by
round
brackets
*
Fixed
assignments
not
handling
multi
-
line
values
correctly
...
...
lib/Dwoo/Loader.php
View file @
ce2fb905
...
...
@@ -45,7 +45,7 @@ class Dwoo_Loader implements Dwoo_ILoader
public
function
__construct
(
$cacheDir
)
{
$this
->
corePluginDir
=
DWOO_DIRECTORY
.
'plugins'
;
$this
->
cacheDir
=
$cacheDir
.
DIRECTORY_SEPARATOR
;
$this
->
cacheDir
=
rtrim
(
$cacheDir
,
DIRECTORY_SEPARATOR
)
.
DIRECTORY_SEPARATOR
;
// include class paths or rebuild paths if the cache file isn't there
$foo
=
@
file_get_contents
(
$this
->
cacheDir
.
'classpath.cache.d'
.
Dwoo
::
RELEASE_TAG
.
'.php'
);
...
...
@@ -70,7 +70,7 @@ class Dwoo_Loader implements Dwoo_ILoader
}
// iterates over all files/folders
$list
=
glob
(
$path
.
DIRECTORY_SEPARATOR
.
'*'
);
$list
=
glob
(
rtrim
(
$path
,
DIRECTORY_SEPARATOR
)
.
DIRECTORY_SEPARATOR
.
'*'
);
if
(
is_array
(
$list
))
{
foreach
(
$list
as
$f
)
{
if
(
is_dir
(
$f
))
{
...
...
lib/Dwoo/Template/File.php
View file @
ce2fb905
...
...
@@ -99,8 +99,6 @@ class Dwoo_Template_File extends Dwoo_Template_String
return
$this
->
includePath
;
}
/**
* Checks if compiled file is valid (exists and it's the modification is greater or
* equal to the modification time of the template file)
...
...
@@ -145,6 +143,7 @@ class Dwoo_Template_File extends Dwoo_Template_String
return
$this
->
file
;
}
else
{
foreach
(
$this
->
includePath
as
$path
)
{
$path
=
rtrim
(
$path
,
DIRECTORY_SEPARATOR
);
if
(
file_exists
(
$path
.
DIRECTORY_SEPARATOR
.
$this
->
file
)
===
true
)
{
$this
->
resolvedPath
=
$path
.
DIRECTORY_SEPARATOR
.
$this
->
file
;
return
$this
->
resolvedPath
;
...
...
lib/Dwoo/Template/String.php
View file @
ce2fb905
...
...
@@ -289,7 +289,7 @@ class Dwoo_Template_String implements Dwoo_ITemplate
// thanks for his help on avoiding concurency issues
$temp
=
tempnam
(
$cacheDir
,
'temp'
);
if
(
!
(
$file
=
@
fopen
(
$temp
,
'wb'
)))
{
$temp
=
$cacheDir
.
DIRECTORY_SEPARATOR
.
uniqid
(
'temp'
);
$temp
=
$cacheDir
.
uniqid
(
'temp'
);
if
(
!
(
$file
=
@
fopen
(
$temp
,
'wb'
)))
{
trigger_error
(
'Error writing temporary file \''
.
$temp
.
'\''
,
E_USER_WARNING
);
return
false
;
...
...
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