src/sysplugins/* to PSR-4

This commit is contained in:
Simon Wisselink
2022-12-22 21:50:01 +01:00
parent 0fc2b3726b
commit f1e7b2d46f
110 changed files with 1226 additions and 1226 deletions

View File

@@ -1,6 +1,7 @@
<?php
use Smarty\Resource\CustomPlugin;
use Smarty\Exception;
/**
* MySQL Resource
@@ -47,14 +48,14 @@ class _MysqlPlugin extends CustomPlugin
/**
* Smarty_Resource_Mysql constructor.
*
* @throws \SmartyException
* @throws \Smarty\Exception
*/
public function __construct()
{
try {
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
} catch (PDOException $e) {
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
throw new Exception('Mysql Resource failed: ' . $e->getMessage());
}
$this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
$this->mtime = $this->db->prepare('SELECT modified FROM templates WHERE name = :name');