Class Smarty_Resource_Mysqls

extends Smarty_Resource_Custom

MySQL Resource Resource Implementation based on the Custom API to use MySQL as the storage resource for Smarty's templates and configs. Note that this MySQL implementation fetches the source and timestamps in a single database query, instead of two separate like resource.mysql.php does. Table definition:

CREATE TABLE IF NOT EXISTS `templates` (
  `name` varchar(100) NOT NULL,
  `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `source` text,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Demo data:

INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello
world"}{$x}');
Methods
Methods inherited from Smarty_Resource_Custom
fetchTimestamp(), populate(), getContent(), getBasename()
Methods inherited from Smarty_Resource
load(), parseResourceName(), getUniqueTemplateName(), source(), populateTimestamp(), buildUniqueResourceName(), checkTimestamps(), renderUncompiled(), populateCompiledFilepath(), process()
Properties
Properties inherited from Smarty_Resource
$sysplugins, $uncompiled, $recompiled, $hasCompiledHandler