Removed some more includes; restore loading controller groups manually

This commit is contained in:
Sam Mousa 2018-11-12 17:46:44 +01:00
parent 5d83143664
commit 13bd53b326
No known key found for this signature in database
GPG Key ID: A18520F9B4301C9D
11 changed files with 5 additions and 93 deletions

View File

@ -1,12 +1,4 @@
<?php
include 'article/add-topic.php';
include 'article/edit-topic.php';
include 'article/delete-topic.php';
include 'article/add.php';
include 'article/edit.php';
include 'article/delete.php';
include 'article/get-all.php';
$articleControllers = new ControllerGroup();
$articleControllers->setGroupPath('/article');

View File

@ -1,17 +1,4 @@
<?php
require_once 'staff/get.php';
require_once 'staff/assign-ticket.php';
require_once 'staff/un-assign-ticket.php';
require_once 'staff/get-tickets.php';
require_once 'staff/get-new-tickets.php';
require_once 'staff/get-all-tickets.php';
require_once 'staff/search-tickets.php';
require_once 'staff/add.php';
require_once 'staff/get-all.php';
require_once 'staff/delete.php';
require_once 'staff/edit.php';
require_once 'staff/last-events.php';
$systemControllerGroup = new ControllerGroup();
$systemControllerGroup->setGroupPath('/staff');

View File

@ -1,32 +1,4 @@
<?php
require_once 'system/check-requirements.php';
require_once 'system/init-database.php';
require_once 'system/init-settings.php';
require_once 'system/init-admin.php';
require_once 'system/installation-done.php';
require_once 'system/get-settings.php';
require_once 'system/edit-settings.php';
require_once 'system/add-department.php';
require_once 'system/edit-department.php';
require_once 'system/delete-department.php';
require_once 'system/get-logs.php';
require_once 'system/get-mail-templates.php';
require_once 'system/edit-mail-template.php';
require_once 'system/recover-mail-template.php';
require_once 'system/disable-registration.php';
require_once 'system/enable-registration.php';
require_once 'system/disable-user-system.php';
require_once 'system/enable-user-system.php';
require_once 'system/add-api-key.php';
require_once 'system/delete-api-key.php';
require_once 'system/get-api-keys.php';
require_once 'system/get-stats.php';
require_once 'system/delete-all-users.php';
require_once 'system/csv-import.php';
require_once 'system/backup-database.php';
require_once 'system/download.php';
require_once 'system/test-smtp.php';
$systemControllerGroup = new ControllerGroup();
$systemControllerGroup->setGroupPath('/system');

View File

@ -1,5 +1,4 @@
<?php
//include '../../config.php';
use RedBeanPHP\Facade as RedBean;
/**

View File

@ -1,19 +1,4 @@
<?php
include 'ticket/create.php';
include 'ticket/comment.php';
include 'ticket/get.php';
include 'ticket/check.php';
include 'ticket/add-custom-response.php';
include 'ticket/delete-custom-response.php';
include 'ticket/edit-custom-response.php';
include 'ticket/get-custom-responses.php';
include 'ticket/change-department.php';
include 'ticket/close.php';
include 'ticket/re-open.php';
include 'ticket/change-priority.php';
include 'ticket/seen.php';
include 'ticket/delete.php';
$ticketControllers = new ControllerGroup();
$ticketControllers->setGroupPath('/ticket');

View File

@ -1,23 +1,4 @@
<?php
include 'user/login.php';
include 'user/signup.php';
include 'user/logout.php';
include 'user/check-session.php';
include 'user/recover-password.php';
include 'user/send-recover-password.php';
include 'user/edit-password.php';
include 'user/edit-email.php';
include 'user/get.php';
include 'user/get-users.php';
include 'user/get-user.php';
include 'user/delete.php';
include 'user/ban.php';
include 'user/un-ban.php';
include 'user/list-ban.php';
include 'user/verify.php';
include 'user/enable.php';
include 'user/disable.php';
$userControllers = new ControllerGroup();
$userControllers->setGroupPath('/user');

View File

@ -1,6 +1,4 @@
<?php
require_once 'data/MailTexts.php';
class InitialMails {
public static function getBody($templateCode, $texts) {

View File

@ -15,5 +15,10 @@ if(defined('MYSQL_HOST') && defined('MYSQL_DATABASE') && defined('MYSQL_USER') &
\Slim\Slim::registerAutoLoader();
$app = new \Slim\Slim();
// LOAD CONTROLLERS
foreach (glob('controllers/*.php') as $controller) {
include_once $controller;
}
Controller::init();
$app->run();

View File

@ -1,7 +1,4 @@
<?php
require_once 'libs/Validator.php';
require_once 'models/Session.php';
use RedBeanPHP\Facade as RedBean;
abstract class Controller {

View File

@ -1,6 +1,4 @@
<?php
require_once 'models/DataStore.php';
class DataStoreList implements IteratorAggregate {
private $list = [];

View File

@ -1,6 +1,4 @@
<?php
require_once 'libs/Controller.php';
use Respect\Validation\Validator as DataValidator;
class ValidationException extends Exception {}