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
|
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2022-12-21 16:33:26 +01:00
|
|
|
use Smarty\Resource\RecompiledPlugin;
|
2022-12-22 21:23:22 +01:00
|
|
|
use Smarty\Template;
|
|
|
|
|
use Smarty\Template\Source;
|
2022-12-21 16:33:26 +01:00
|
|
|
|
2023-01-06 21:53:37 +01:00
|
|
|
class Smarty_Resource_Db2 extends RecompiledPlugin
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
2022-12-22 21:23:22 +01:00
|
|
|
public function populate(Source $source, Template $_template = null)
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
|
|
|
|
$source->filepath = 'db2:';
|
|
|
|
|
$source->uid = sha1($source->resource);
|
|
|
|
|
$source->timestamp = 0;
|
|
|
|
|
$source->exists = true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-22 21:23:22 +01:00
|
|
|
public function getContent(Source $source)
|
2020-04-13 15:30:52 +02:00
|
|
|
{
|
|
|
|
|
return '{$x="hello world"}{$x}';
|
|
|
|
|
}
|
|
|
|
|
}
|