1<?php
2/**
3 * PHPTAL templating engine
4 *
5 * PHP Version 5
6 *
7 * @category HTML
8 * @package  PHPTAL
9 * @author   Laurent Bedubourg <lbedubourg@motion-twin.com>
10 * @author   Kornel Lesiński <kornel@aardvarkmedia.co.uk>
11 * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12 * @version  SVN: $Id$
13 * @link     http://phptal.org/
14 */
15
16/**
17 * You can implement this interface to load templates from various sources (see SourceResolver)
18 *
19 * @package PHPTAL
20 */
21interface PHPTAL_Source
22{
23    /**
24     * unique path identifying the template source.
25     * must not be empty. must be as unique as possible.
26     *
27     * it doesn't have to be path on disk.
28     *
29     * @return string
30     */
31    public function getRealPath();
32
33    /**
34     * template source last modified time (unix timestamp)
35     * Return 0 if unknown.
36     *
37     * If you return 0:
38     *  • PHPTAL won't know when to reparse the template,
39     *    unless you change realPath whenever template changes.
40     *  • clearing of cache will be marginally slower.
41     *
42     * @return long
43     */
44    public function getLastModifiedTime();
45
46    /**
47     * the template source
48     *
49     * @return string
50     */
51    public function getData();
52}
53