Skip to content

Commit d0e3d59

Browse files
authored
Merge pull request #11 from HallofFamer/master
Update Parser.php
2 parents 734ef9d + 06891ac commit d0e3d59

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

source/Parser.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ public function getDiscoveredCompilers()
9090
public function process($from)
9191
{
9292
$to = preg_replace("/\.[a-zA-Z]+$/", ".php", $from);
93-
$this->compile($from, $to);
94-
93+
if(!$this->isProcessed($from, $to)) {
94+
$this->compile($from, $to);
95+
}
9596
return require $to;
9697
}
9798

99+
private function isProcessed($from, $to)
100+
{
101+
return (file_exists($to) && (filemtime($from) < filemtime($to)));
102+
}
103+
98104
public function compile($from, $to, $format = true, $comment = true)
99105
{
100106
if (file_exists($from)) {

0 commit comments

Comments
 (0)