Commit 4d29e011 by Seldaek

git-svn-id: svn://dwoo.org/dwoo/trunk@52 0598d79b-80c4-4d41-97ba-ac86fbbd088b

parent f9cc66d3
......@@ -61,11 +61,11 @@ class Dwoo_Template_File extends Dwoo_Template_String
if($cacheId === null)
{
if(isset($_SERVER['REQUEST_URI']) === true)
$cacheId = strtr($_SERVER['REQUEST_URI'], '\\/%?=!:;', '--------');
$cacheId = $_SERVER['REQUEST_URI'];
elseif(isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv']))
$cacheId = strtr($_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']), '\\/%?=!:;', '--------');
$cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']);
}
$this->cacheId = $this->compileId . $cacheId;
$this->cacheId = $this->compileId . strtr($cacheId, '\\/%?=!:;', '--------');
}
/**
......@@ -112,7 +112,6 @@ class Dwoo_Template_File extends Dwoo_Template_String
$compiler->setCustomPlugins($dwoo->getCustomPlugins());
$compiler->setSecurityPolicy($dwoo->getSecurityPolicy());
file_put_contents($compiledFile, $compiler->compile($dwoo, $this));
touch($compiledFile, max($_SERVER['REQUEST_TIME'], filemtime($this->file)));
self::$cache['compiled'][$this->compileId] = true;
}
......
......@@ -110,11 +110,11 @@ class Dwoo_Template_String implements Dwoo_ITemplate
if($cacheId === null)
{
if(isset($_SERVER['REQUEST_URI']) === true)
$cacheId = strtr($_SERVER['REQUEST_URI'], '\\/%?=!:;*"<>|', '-------------');
$cacheId = $_SERVER['REQUEST_URI'];
elseif(isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv']))
$cacheId = strtr($_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']), '\\/%?=!:;', '--------');
$cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']);
}
$this->cacheId = $this->compileId . $cacheId;
$this->cacheId = $this->compileId . strtr($cacheId, '\\/%?=!:;', '--------');
}
/**
......@@ -336,7 +336,6 @@ class Dwoo_Template_String implements Dwoo_ITemplate
$compiler->setCustomPlugins($dwoo->getCustomPlugins());
$compiler->setSecurityPolicy($dwoo->getSecurityPolicy());
file_put_contents($compiledFile, $compiler->compile($dwoo, $this));
touch($compiledFile, $_SERVER['REQUEST_TIME']);
self::$cache['compiled'][$this->compileId] = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment