Take templates from inside .phar if dir doesn't exist

This commit is contained in:
Stéphane Goetz 2016-01-25 16:10:13 +01:00
parent 3b9307c84d
commit 5d6dc9a8b1
2 changed files with 5 additions and 0 deletions

BIN
daux.phar

Binary file not shown.

View File

@ -15,6 +15,11 @@ class Template
*/
public function __construct($base, $theme)
{
// Use templates from the phar archive if the templates dir doesn't exist.
if (!is_dir($base)) {
$base = 'phar://daux.phar/templates';
}
// Create new Plates instance
$this->engine = new Engine($base);
if (!is_dir($theme)) {