Files
FHeD/app/includes/prereqs.php
Alexander Davis 26da6e7616 Updates (#134)
* 🐛 User not added to DB - force die() on error (#118)

* 🐛 User not added to DB - force die() on error

Signed-off-by: Luke Tainton <luke@tainton.uk>

* Restyled by php-cs-fixer (#119)

Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>

* Fixing Login Die

* Broken login (#121)

* Fixing Login Die

* Fix Broken Login 2

* Broken login (#122)

* Fixing Login Die

* Fix Broken Login 2

* Update footer

* Try Somethin New Today

* Move break rule in footer (#124)

* Update footer.php

* Change line break to pipe

* Remove full stop

Co-authored-by: Alexander Davis <alex@adcm.uk>

*  Add Sentry (#127)

Signed-off-by: Luke Tainton <luke@tainton.uk>

* 🚧 Migrate from Sentry to GlitchTip (#129)

Signed-off-by: Luke Tainton <luke@tainton.uk>

* 🐛 Move opening and closing 'main' tags (#132)

* 🐛 Move opening and closing 'main' tags

Signed-off-by: Luke Tainton <luke@tainton.uk>

* Restyled by php-cs-fixer (#133)

Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: Luke Tainton <luke@tainton.uk>
Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2020-09-01 01:54:06 +01:00

46 lines
1.2 KiB
PHP

<?php
// Composer
require_once __DIR__ . "/../vendor/autoload.php";
// PHPDotEnv
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . "/..");
$dotenv->load();
// Custom functions
require_once __DIR__ . "/app_functions.php";
// Sentry
Sentry\init([
'dsn' => 'https://7c4607ed5e804d08926cc0bbc0d3fbe9@app.glitchtip.com/59',
'release' => get_version(),
]);
// Database auto-generation
if (file_exists("/../includes/install.php")) {
return;
add_action('run_db_populate');
}
function run_db_populate() {
// all my glorious one-time-magic.
include( "/../includes/install.php" );
// after all execution rename your file;
rename( "/../includes/install.php", "/../includes/install-backup.php");
}
// Session
session_start();
// Database
$db = new PDO("mysql:host=".$_ENV['MYSQL_HOST'].";dbname=".$_ENV['MYSQL_DB'], $_ENV['MYSQL_USER'], $_ENV['MYSQL_PASS']);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// OpenID Connect
use Jumbojett\OpenIDConnectClient;
$oidc = new OpenIDConnectClient($_ENV['OIDC_HOST'], $_ENV['OIDC_CLIENT_ID'], $_ENV['OIDC_CLIENT_SECRET']);
if ($_ENV['OIDC_DISABLE_SSL'] == "true") {
$oidc->setVerifyHost(false);
$oidc->setVerifyPeer(false);
}