mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 15:21:37 +01:00
src/sysplugins/* to PSR-4
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user