Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB;
|
||||
|
||||
// composer dump-autoload -o
|
||||
|
||||
use Medoo\Medoo;
|
||||
use PDO;
|
||||
|
||||
class MariaDB
|
||||
{
|
||||
public static $db_handle = 0;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if ($_SERVER['SERVER_NAME'] == 'gutachten.test') {
|
||||
$mariadb_host = 'host.docker.internal';
|
||||
$mariadb_user = 'root';
|
||||
$mariadb_pass = 'salam';
|
||||
$mariadb_db = 'gutachten_t3';
|
||||
}else {
|
||||
$mariadb_host = '172.18.0.1';
|
||||
$mariadb_user = 'root';
|
||||
$mariadb_pass = 'salam';
|
||||
$mariadb_db = 'gutachten_t3';
|
||||
}
|
||||
|
||||
self::$db_handle = new Medoo([
|
||||
// required
|
||||
'database_type' => 'mysql',
|
||||
'database_name' => $mariadb_db,
|
||||
'server' => $mariadb_host,
|
||||
'username' => $mariadb_user,
|
||||
'password' => $mariadb_pass,
|
||||
|
||||
// [optional]
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_general_ci',
|
||||
'port' => 3306,
|
||||
|
||||
// [optional] Table prefix
|
||||
// 'prefix' => 'PREFIX_',
|
||||
|
||||
// [optional] Enable logging (Logging is disabled by default for better performance)
|
||||
'logging' => false,
|
||||
|
||||
// [optional] MySQL socket (shouldn't be used with server and port)
|
||||
// 'socket' => '/tmp/mysql.sock',
|
||||
|
||||
// [optional] driver_option for connection, read more from http://www.php.net/manual/en/pdo.setattribute.php
|
||||
'option' => [
|
||||
PDO::ATTR_ERRMODE,
|
||||
PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_CASE => PDO::CASE_NATURAL,
|
||||
PDO::ATTR_EMULATE_PREPARES, false,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE,
|
||||
PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_TIMEOUT => 3600,
|
||||
],
|
||||
|
||||
// [optional] Medoo will execute those commands after connected to the database for initialization
|
||||
'command' => [
|
||||
'SET SQL_MODE=ANSI_QUOTES',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user