summaryrefslogtreecommitdiff
path: root/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php
blob: 455255e248e534f467d31300a84b3779edb6414c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     resource.db3.php
 * Type:     resource
 * Name:     db
 * Purpose:  Fetches templates from a database
 * -------------------------------------------------------------
 */

use Smarty\Template;
use Smarty\Template\Source;

class Smarty_Resource_Db3 extends Smarty\Resource\BasePlugin
{
    public function populate(Source $source, Template $_template = null)
    {
        $source->uid = sha1($source->resource);
        $source->timestamp = 0;
        $source->exists = true;
    }

    public function getContent(Source $source)
    {
        return '{$x="hello world"}{$x}';
    }

    public function getCompiledFilepath(Template $_template)
    {
        return false;
    }
}