Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make sure the path to store the compiled template exists
  • Loading branch information
WanWizard committed Jan 17, 2018
1 parent 8e4ffae commit 71450b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions classes/view/handlebars.php
Expand Up @@ -36,6 +36,13 @@ protected function process_file($file_override = false)
// do we need to compile?
if ( ! is_file($compiled) or filemtime($file) > filemtime($compiled) or \Config::get('parser.View_Handlebars.force_compile', true))
{
// make sure the directory exists
if ( ! is_dir($compiled_path = dirname($compiled)))
{
\File::create_dir($path, substr($compiled_path, strlen($path)));
}

// write the compiled code
file_put_contents($compiled, '<?php ' . LightnCandy::compile(
file_get_contents($file),
array(
Expand Down

0 comments on commit 71450b2

Please sign in to comment.