summaryrefslogtreecommitdiff
path: root/poc/poc02-compiling-cake/src
diff options
context:
space:
mode:
Diffstat (limited to 'poc/poc02-compiling-cake/src')
-rw-r--r--poc/poc02-compiling-cake/src/php-weave/cakephp_weaver.class.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/poc/poc02-compiling-cake/src/php-weave/cakephp_weaver.class.php b/poc/poc02-compiling-cake/src/php-weave/cakephp_weaver.class.php
index 5e4f7de..198b113 100644
--- a/poc/poc02-compiling-cake/src/php-weave/cakephp_weaver.class.php
+++ b/poc/poc02-compiling-cake/src/php-weave/cakephp_weaver.class.php
@@ -32,8 +32,12 @@ class CakePHPWeaver extends AbstractWeaver {
$env=$fw_props; //TODO : More things here ?
foreach ($filelist as $f) {
- //TODO : cache match
$cache_filepath=$cache_path . "/" . sha1($f) . "-" . substr(sha1(print_r($env,true)),-8,8) . ".ast";
+ // If the cache is already up to date, skip parsing
+ if ( $stat_cache=stat($cache_filepath) ) {
+ $stat_source=stat($f);
+ if ($stat_cache['mtime'] >= $stat_source['mtime'] ) continue;
+ }
$ast=$this->parseAndWalk($f, null, $env);
$this->serializeAST($ast, $f, $cache_filepath);