better handle missing auth header, set explicit response types to not get warnings...
[authserver.git] / app / authsystem.inc.php
CommitLineData
133aecbe 1<?php
d46a42f1
RK
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5
133aecbe
RK
6// error reporting (for testing)
7ini_set('display_errors', 1); error_reporting(E_ALL);
8
133aecbe 9// Extended DOM document class
2b9aa8f3 10require_once(__DIR__.'/../php-utility-classes/classes/document.php-class');
b19743bc 11// Class for sending emails
2b9aa8f3
RK
12require_once(__DIR__.'/../php-utility-classes/classes/email.php-class');
13// Composer-provided libraries (oauth2-server-php, doctrine DBAL)
14require_once(__DIR__.'/../vendor/autoload.php');
2b9aa8f3
RK
15// Authentication utilities
16require_once(__DIR__.'/authutils.php-class');
17// Instantiate server utils.
18try {
9ea26dfc 19 $utils = new AuthUtils();
74b24877 20 $db = $utils->db;
9ea26dfc 21 $settings = $utils->settings;
2b9aa8f3
RK
22}
23catch (Exception $e) {
24 $utils = null;
9ea26dfc
RK
25 print('Failed to set up utilities: '.$e->getMessage());
26 exit(1);
2b9aa8f3 27}
d26d08a1 28
74b24877 29$utils->setUpL10n();
8b69f29c 30
74b24877
RK
31// Set up our OAuth2 Server object
32$server = $utils->getOAuthServer();
133aecbe 33?>