flash.moe/public/_v4/includes.php

29 lines
1,003 B
PHP
Raw Normal View History

2020-08-20 00:02:37 +00:00
<?php
2022-02-05 03:35:42 +00:00
define('FM_DEBUG', false);
2020-08-20 00:02:37 +00:00
2022-02-05 03:35:42 +00:00
error_reporting(0);
ini_set('display_errors', 'off');
2020-08-20 00:02:37 +00:00
date_default_timezone_set('UTC');
mb_internal_encoding('UTF-8');
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);
try {
2021-07-29 21:58:32 +00:00
$pdo = new PDO('mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=website;charset=utf8mb4', 'website', 'A3NjVvHRkHAxiYgk8MM4ZrCwrLVyPIYX', [
2020-08-20 00:02:37 +00:00
PDO::ATTR_CASE => PDO::CASE_NATURAL,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => "
SET SESSION
sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION',
time_zone = '+00:00';
",
]);
} catch(Exception $ex) {
2021-07-07 01:13:50 +00:00
http_response_code(500);
2020-08-20 00:02:37 +00:00
echo '<h3>Unable to connect to database</h3>';
die($ex->getMessage());
}