willy.club/app/App/Database.php

21 lines
352 B
PHP
Raw Normal View History

2023-02-03 11:00:13 +00:00
<?php
namespace App;
use \PDO;
use App\Config;
abstract class Database
{
private static PDO $handle;
static function get_handle(): PDO
{
if (!isset(self::$handle)) {
self::$handle = new PDO(
'sqlite:' . Config::get('path_to_sqlite_file')
);
}
return self::$handle;
}
}