Mods-for-HESK-Netsyms/api/autoload.php

40 lines
1.3 KiB
PHP
Raw Normal View History

<?php
2017-02-01 22:04:52 -05:00
// Files that are needed that aren't classes, as well as basic initialization
2017-01-28 01:41:29 -05:00
// Core requirements
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
require_once(__DIR__ . '/vendor/autoload.php');
2017-02-01 22:04:52 -05:00
require_once(__DIR__ . '/bootstrap.php');
2017-01-28 01:41:29 -05:00
require_once(__DIR__ . '/../hesk_settings.inc.php');
require_once(__DIR__ . '/../inc/common.inc.php');
2017-02-01 22:04:52 -05:00
require_once(__DIR__ . '/Core/output.php');
require_once(__DIR__ . '/../hesk_settings.inc.php');
require_once(__DIR__ . '/http_response_code.php');
require_once(__DIR__ . '/../inc/admin_functions.inc.php');
require_once(__DIR__ . '/../inc/htmlpurifier/HeskHTMLPurifier.php');
hesk_load_api_database_functions();
2017-03-06 21:44:38 -05:00
global $hesk_settings;
// HESK files that require database access
require_once(__DIR__ . '/../inc/custom_fields.inc.php');
2017-01-28 01:41:29 -05:00
// Load the ApplicationContext
2017-09-09 21:24:05 -04:00
$builder = new \DI\ContainerBuilder();
2017-12-06 12:45:44 -05:00
$applicationContext = $builder->build();
// Fix for getallheaders() on PHP-FPM and nginx
if (!function_exists('getallheaders')) {
function getallheaders() {
2017-12-06 21:39:08 -05:00
$headers = array();
2017-12-06 12:45:44 -05:00
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}