WIP on PHP (Leaf) version

This commit is contained in:
2023-08-20 17:27:02 -04:00
parent 3df5c71d81
commit 0ec4fd017f
27 changed files with 2318 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace BitBadger\PgSQL\Documents;
/**
* Document table configuration
*/
class Configuration
{
/** @var string $connectionString The connection string to use when establishing a database connection */
public static string $connectionString = "";
/** @var ?\PDO $conn The active connection */
private static ?\PDO $conn = null;
/**
* Get the database connection, connecting on first request
*
* @return PDO The PDO object representing the connection
*/
public static function getConn(): \PDO
{
if (is_null(Configuration::$conn)) {
Configuration::$conn = new \PDO(Configuration::$connectionString);
}
return Configuration::$conn;
}
}
require('functions.php');