1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 09:02:41 +00:00
Arsse/vendor/JKingWeb/NewsSync/Db/DriverSQLite3PDO.php
J. King 6ffe942f99 SQLite3 database driver in working condition
PDO stub for now; other drivers to come
2016-10-05 22:08:43 -04:00

28 lines
No EOL
742 B
PHP

<?php
declare(strict_types=1);
namespace JKingWeb\NewsSync\Db;
class DriverSQLite3 implements Driver {
use CommonPDO, CommonSQLite3;
protected $db;
private function __construct(\JKingWeb\NewsSync\Conf $conf, bool $install = false) {
// FIXME: stub
}
public function __destruct() {
// FIXME: stub
}
static public function create(\JKingWeb\NewsSync\Conf $conf, bool $install = false): Driver {
// check to make sure required extensions are loaded
if(class_exists("PDO") && in_array("sqlite",\PDO::getAvailableDrivers())) {
return new self($conf, $install);
} else if(class_exists("SQLite3")) {
return new DriverSQLite3($conf, $install);
} else {
throw new Exception("extMissing", self::driverName());
}
}
}