Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Clansuite/Clansuite into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Aug 16, 2012
2 parents 66e9968 + 49fc65e commit cb193ef
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions framework/Koch/View/Renderer/Php.php
Expand Up @@ -58,21 +58,26 @@ public function fetch($filename = null, array $data = array())
$file = $this->file;
}

if (is_file($file) === true) {
/**
* extract all template variables to local scope,
* but do not overwrite an existing variable.
* on collision, prefix variable with "invalid_".
*/
extract($this->data, EXTR_REFS | EXTR_PREFIX_INVALID, 'invalid_');

ob_start();

/**
* extract all template variables to local scope,
* but do not overwrite an existing variable.
* on collision, prefix variable with "invalid_".
*/
extract($this->data, EXTR_REFS | EXTR_PREFIX_INVALID, 'invalid_');

ob_start();

try {
include $file; // conditional include; not require !
} catch (\Exception $e) {
// clean buffer before throwing exception
ob_get_clean();
throw $e;
// throw new Koch_Excpetion('PHP Renderer Error: Template ' . $file . ' not found!', 99);
}

return ob_get_clean();
} else {
throw new Koch_Excpetion('PHP Renderer Error: Template ' . $file . ' not found!', 99);
}
return ob_get_clean();
}

/**
Expand Down

0 comments on commit cb193ef

Please sign in to comment.