Moved some more stuff to new structure
parent
2ef67de718
commit
e68ecf50c6
@ -1,25 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Responsible for loading in all necessary scripts and kicking off the DependencyManager
|
// Responsible for loading in all necessary scripts and kicking off the DependencyManager
|
||||||
|
// Core requirements
|
||||||
define('IN_SCRIPT', 1);
|
define('IN_SCRIPT', 1);
|
||||||
define('HESK_PATH', '../');
|
define('HESK_PATH', '../');
|
||||||
require_once(__DIR__ . '/core/common.php');
|
require_once(__DIR__ . '/../hesk_settings.inc.php');
|
||||||
|
require_once(__DIR__ . '/../inc/common.inc.php');
|
||||||
|
require_once(__DIR__ . '/core/output.php');
|
||||||
require_once(__DIR__ . '/Link.php');
|
require_once(__DIR__ . '/Link.php');
|
||||||
require_once(__DIR__ . '/../hesk_settings.inc.php');
|
require_once(__DIR__ . '/../hesk_settings.inc.php');
|
||||||
|
|
||||||
// FILES
|
// Mods for HESK API Files
|
||||||
require_once(__DIR__ . '/http_response_code.php');
|
require_once(__DIR__ . '/http_response_code.php');
|
||||||
|
|
||||||
|
// Categories
|
||||||
require_once(__DIR__ . '/dao/category/CategoryGateway.php');
|
require_once(__DIR__ . '/dao/category/CategoryGateway.php');
|
||||||
require_once(__DIR__ . '/businesslogic/category/CategoryRetriever.php');
|
require_once(__DIR__ . '/businesslogic/category/CategoryRetriever.php');
|
||||||
require_once(__DIR__ . '/businesslogic/category/Category.php');
|
require_once(__DIR__ . '/businesslogic/category/Category.php');
|
||||||
require_once(__DIR__ . '/controllers/CategoryController.php');
|
require_once(__DIR__ . '/controllers/CategoryController.php');
|
||||||
|
|
||||||
|
// Banned Emails / IP Addresses
|
||||||
|
require_once(__DIR__ . '/dao/security/BanGateway.php');
|
||||||
|
require_once(__DIR__ . '/businesslogic/security/BanRetriever.php');
|
||||||
|
require_once(__DIR__ . '/businesslogic/security/BannedEmail.php');
|
||||||
|
require_once(__DIR__ . '/businesslogic/security/BannedIp.php');
|
||||||
|
|
||||||
hesk_load_api_database_functions();
|
hesk_load_api_database_functions();
|
||||||
|
|
||||||
// HESK files that require database access
|
// HESK files that require database access
|
||||||
require_once(__DIR__ . '/../inc/custom_fields.inc.php');
|
require_once(__DIR__ . '/../inc/custom_fields.inc.php');
|
||||||
|
|
||||||
require_once(__DIR__ . '/DependencyManager.php');
|
// Load the ApplicationContext
|
||||||
|
require_once(__DIR__ . '/ApplicationContext.php');
|
||||||
$applicationContext = new \Core\DependencyManager();
|
$applicationContext = new \Core\ApplicationContext();
|
@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// Contains all common requirements. Nothing more.
|
|
||||||
require_once(__DIR__ . '/../../hesk_settings.inc.php');
|
|
||||||
require_once(__DIR__ . '/../../inc/common.inc.php');
|
|
||||||
require_once(__DIR__ . '/../core/output.php');
|
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by PhpStorm.
|
||||||
|
* User: Mike
|
||||||
|
* Date: 1/28/2017
|
||||||
|
* Time: 1:33 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace DataAccess;
|
||||||
|
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
class CommonDao {
|
||||||
|
/**
|
||||||
|
* @throws Exception if the database isn't properly configured
|
||||||
|
*/
|
||||||
|
function init() {
|
||||||
|
if (!function_exists('hesk_dbConnect')) {
|
||||||
|
throw new Exception('Database not loaded!');
|
||||||
|
}
|
||||||
|
hesk_dbConnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
hesk_dbClose();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue