21 lines
352 B
PHP
21 lines
352 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|