2020-04-13 15:30:52 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Smarty plugin
|
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
|
* File: resource.db2.php
|
|
|
|
|
* Type: resource
|
|
|
|
|
* Name: db
|
|
|
|
|
* Purpose: Fetches templates from a database
|
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2023-08-08 00:04:14 +02:00
|
|
|
use Smarty\Resource\RecompiledPlugin;
|
|
|
|
|
use Smarty\Template;
|
|
|
|
|
use Smarty\Template\Source;
|
|
|
|
|
|
|
|
|
|
class Smarty_Resource_Db2 extends RecompiledPlugin
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
2024-11-20 15:59:26 +01:00
|
|
|
public function populate(Source $source, ?Template $_template = null)
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
|
|
|
|
$source->uid = sha1($source->resource);
|
|
|
|
|
$source->timestamp = 0;
|
|
|
|
|
$source->exists = true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-08 00:04:14 +02:00
|
|
|
public function getContent(Source $source)
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
|
|
|
|
return '{$x="hello world"}{$x}';
|
|
|
|
|
}
|
|
|
|
|
}
|