src/wp_db_light.php aktualisiert
This commit is contained in:
@@ -5,10 +5,15 @@ namespace WP_DB;
|
||||
class WP_DB_LIGHT extends WP_DB
|
||||
{
|
||||
public $dbName;
|
||||
public $path = false;
|
||||
|
||||
function connect()
|
||||
{
|
||||
$databaseFile = '/sql/'.$this->dbName.'.db';
|
||||
$path = '/sql/';
|
||||
if ($this->path) {
|
||||
$path .= $this->path . "/";
|
||||
}
|
||||
$databaseFile = $path . $this->dbName . '.db';
|
||||
$pdo = new \PDO("sqlite:$databaseFile");
|
||||
|
||||
// Set the error mode to exception
|
||||
@@ -17,5 +22,10 @@ class WP_DB_LIGHT extends WP_DB
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
|
||||
function createPathIfnotExists($folderPath)
|
||||
{
|
||||
if (!file_exists($folderPath)) {
|
||||
mkdir($folderPath, 0777, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user