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
3a66a7cd
Commit
3a66a7cd
authored
Apr 05, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixes two class path glitches
git-svn-id:
svn://dwoo.org/dwoo/trunk@11
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
fca0a519
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Dwoo.php
Dwoo.php
+2
-2
CompilerTests.php
tests/CompilerTests.php
+2
-2
DwooTests.php
tests/DwooTests.php
+2
-2
No files found.
Dwoo.php
View file @
3a66a7cd
...
...
@@ -18,7 +18,7 @@ if(is_writable(DWOO_COMPILE_DIRECTORY) === false)
// include class paths or rebuild paths if the cache file isn't there
if
((
file_exists
(
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath.cache.php'
)
&&
include
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath.cache.php'
)
===
false
)
DwooLoader
::
rebuildClassPathCache
(
DWOO_DIRECTORY
.
'plugins'
,
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath.cache'
);
DwooLoader
::
rebuildClassPathCache
(
DWOO_DIRECTORY
.
'plugins'
,
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath.cache
.php
'
);
DwooLoader
::
loadPlugin
(
'topLevelBlock'
);
...
...
@@ -1501,7 +1501,7 @@ class DwooLoader
*/
public
static
function
addDirectory
(
$pluginDir
)
{
$cacheFile
=
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath-'
.
substr
(
strtr
(
$pluginDir
,
':/\\.'
,
'----'
),
-
8
0
)
.
'.cache.php'
;
$cacheFile
=
DWOO_COMPILE_DIRECTORY
.
DIRECTORY_SEPARATOR
.
'classpath-'
.
substr
(
strtr
(
$pluginDir
,
':/\\.'
,
'----'
),
strlen
(
$pluginDir
)
>
80
?
-
80
:
0
)
.
'.cache.php'
;
self
::
$paths
[]
=
array
(
$pluginDir
,
$cacheFile
);
if
(
file_exists
(
$cacheFile
))
include
$cacheFile
;
...
...
tests/CompilerTests.php
View file @
3a66a7cd
...
...
@@ -138,10 +138,10 @@ class CompilerTests extends PHPUnit_Framework_TestCase
public
function
testExpressions
()
{
$tpl
=
new
DwooTemplateString
(
'{$foo+5} {$foo+$foo} {$foo+3*$foo} {$foo*$foo+4*$foo} {$foo*2/2|number_format} {$foo*2/3|number_format:1} {number_format $foo*2/3 1}'
);
$tpl
=
new
DwooTemplateString
(
'{$foo+5} {$foo+$foo} {$foo+3*$foo} {$foo*$foo+4*$foo} {$foo*2/2|number_format} {$foo*2/3|number_format:1} {number_format $foo*2/3 1}
{if $foo+5>9 && $foo < 7 && $foo+$foo==$foo*2}win{/if} {$arr[$foo+3]}
'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"10 10 40 145 5 3.3 3.3
"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'foo'
=>
5
),
$this
->
compiler
));
$this
->
assertEquals
(
"10 10 40 145 5 3.3 3.3
win win"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'foo'
=>
5
,
'arr'
=>
array
(
8
=>
'win'
)
),
$this
->
compiler
));
$tpl
=
new
DwooTemplateString
(
'{"$foo/$foo"}'
);
$tpl
->
forceCompilation
();
...
...
tests/DwooTests.php
View file @
3a66a7cd
<?php
define
(
'DWOO_CACHE
DIR
'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'cache'
);
define
(
'DWOO_COMPILE
DIR
'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'compiled'
);
define
(
'DWOO_CACHE
_DIRECTORY
'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'cache'
);
define
(
'DWOO_COMPILE
_DIRECTORY
'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'compiled'
);
require
dirname
(
dirname
(
__FILE__
))
.
DIRECTORY_SEPARATOR
.
'Dwoo.php'
;
class
DwooTests
{
...
...
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