Project import generated by Copybara.

GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/core.php b/src/core.php
new file mode 100644
index 0000000..1e280d0
--- /dev/null
+++ b/src/core.php
@@ -0,0 +1,40 @@
+<?php
+// Core of the application
+
+const INTERNAL_CLASS_NAMESPACE = "Internal\\";
+
+// Classes autoload
+spl_autoload_register(function($className) {
+  if ($className == "lbuchs\WebAuthn\Binary\ByteBuffer") {
+    include_once(__DIR__."/lib/WebAuthn/Binary/ByteBuffer.php");
+    return;
+  }
+
+
+  include_once(__DIR__."/inc/".$className.".php");
+});
+
+// Getting configuration
+require_once(__DIR__."/config.php");
+
+// Setting timezone and locale accordingly
+date_default_timezone_set("Europe/Madrid");
+setlocale(LC_TIME, 'es_ES.UTF-8', 'es_ES', 'es');
+
+// Database settings
+$con = @mysqli_connect($conf["db"]["server"], $conf["db"]["user"], $conf["db"]["password"], $conf["db"]["database"]) or die("There was an error connecting to the database.\n");
+mysqli_set_charset($con, "utf8mb4");
+
+// Session settings
+session_set_cookie_params([
+  "lifetime" => 0,
+  "path" => $conf["path"],
+  "httponly" => true
+]);
+session_start();
+
+// Check if app has been installed
+if (db::needsSetUp()) {
+  security::logout();
+  die("Please, run install.php from the command line to install the app before using it.");
+}