summaryrefslogtreecommitdiff
path: root/tests/test.php
blob: 41713dc79a872cb5d0c6f2276a607db1825c8e75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

require(dirname(__FILE__) . "/../stupid_template_engine.php");
require("code.php");

class TestStorage implements \ste\StorageAccess {
	public function load($tpl, &$mode) {
		$mode = \ste\MODE_SOURCE;
		return file_get_contents($tpl);
	}
	
	public function save($tpl, $data, $mode) {
		if($mode != \ste\MODE_TRANSCOMPILED) {
			return;
		}
		
		file_put_contents("$tpl.transc.php", $data);
	}
}

$ste = new \ste\STECore(new TestStorage());
test_func($ste);
echo $ste->exectemplate("test.tpl");