Add a BaseClass/BaseException for 5.4 compatibility

master
Mike Koch 7 years ago
parent 3c4018ace3
commit 016a50878d
No known key found for this signature in database
GPG Key ID: 9BA5D7F8391455ED

@ -0,0 +1,7 @@
<?php
class BaseClass {
static function clazz() {
return get_called_class();
}
}

@ -0,0 +1,7 @@
<?php
class BaseException extends Exception {
static function clazz() {
return get_called_class();
}
}

@ -3,7 +3,7 @@
namespace BusinessLogic\Attachments;
class Attachment {
class Attachment extends \BaseClass {
/* @var $id int */
public $id;

@ -17,7 +17,7 @@ use DataAccess\Files\FileDeleter;
use DataAccess\Files\FileWriter;
use DataAccess\Tickets\TicketGateway;
class AttachmentHandler {
class AttachmentHandler extends \BaseClass {
/* @var $ticketGateway TicketGateway */
private $ticketGateway;

@ -10,7 +10,7 @@ use DataAccess\Attachments\AttachmentGateway;
use DataAccess\Files\FileReader;
use DataAccess\Tickets\TicketGateway;
class AttachmentRetriever {
class AttachmentRetriever extends \BaseClass {
/* @var $attachmentGateway AttachmentGateway */
private $attachmentGateway;

@ -3,7 +3,7 @@
namespace BusinessLogic\Attachments;
class AttachmentType {
class AttachmentType extends \BaseClass {
const MESSAGE = 0;
const REPLY = 1;
}

@ -3,7 +3,7 @@
namespace BusinessLogic\Attachments;
class CreateAttachmentModel {
class CreateAttachmentModel extends \BaseClass {
/* @var $savedName string */
public $savedName;

@ -2,7 +2,7 @@
namespace BusinessLogic\Categories;
class Category {
class Category extends \BaseClass {
/**
* @var int The Categories ID
*/

@ -13,7 +13,7 @@ use DataAccess\Categories\CategoryGateway;
use DataAccess\Settings\ModsForHeskSettingsGateway;
use DataAccess\Tickets\TicketGateway;
class CategoryHandler {
class CategoryHandler extends \BaseClass {
/* @var $categoryGateway CategoryGateway */
private $categoryGateway;

@ -6,7 +6,7 @@ use BusinessLogic\Security\UserContext;
use DataAccess\Categories\CategoryGateway;
use DataAccess\Settings\ModsForHeskSettingsGateway;
class CategoryRetriever {
class CategoryRetriever extends \BaseClass {
/**
* @var CategoryGateway
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Emails;
class Addressees {
class Addressees extends \BaseClass {
/**
* @var $to string[]
*/

@ -7,7 +7,7 @@ use BusinessLogic\Tickets\Attachment;
use BusinessLogic\Tickets\Ticket;
use PHPMailer;
class BasicEmailSender implements EmailSender {
class BasicEmailSender extends \BaseClass implements EmailSender {
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings, $sendAsHtml) {
$mailer = new PHPMailer();

@ -5,7 +5,7 @@ namespace BusinessLogic\Emails;
use BusinessLogic\Tickets\Attachment;
class EmailBuilder {
class EmailBuilder extends \BaseClass {
/**
* @var $to string[]
*/

@ -5,7 +5,7 @@ namespace BusinessLogic\Emails;
use BusinessLogic\Tickets\Ticket;
class EmailSenderHelper {
class EmailSenderHelper extends \BaseClass {
/**
* @var $emailTemplateParser EmailTemplateParser
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Emails;
class EmailTemplate {
class EmailTemplate extends \BaseClass {
/**
* @var $languageKey string
*/

@ -13,7 +13,7 @@ use DataAccess\Categories\CategoryGateway;
use DataAccess\Security\UserGateway;
use DataAccess\Statuses\StatusGateway;
class EmailTemplateParser {
class EmailTemplateParser extends \BaseClass {
/**
* @var $statusGateway StatusGateway

@ -3,7 +3,7 @@
namespace BusinessLogic\Emails;
class EmailTemplateRetriever {
class EmailTemplateRetriever extends \BaseClass {
/**
* @var $validTemplates EmailTemplate[]
*/

@ -7,7 +7,7 @@ use BusinessLogic\Tickets\Attachment;
use BusinessLogic\Tickets\Ticket;
use Mailgun\Mailgun;
class MailgunEmailSender implements EmailSender {
class MailgunEmailSender extends \BaseClass implements EmailSender {
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings, $sendAsHtml) {
$mailgunArray = array();

@ -3,7 +3,7 @@
namespace BusinessLogic\Emails;
class ParsedEmailProperties {
class ParsedEmailProperties extends \BaseClass {
function __construct($subject, $message, $htmlMessage) {
$this->subject = $subject;
$this->message = $message;

@ -5,7 +5,7 @@ namespace BusinessLogic\Exceptions;
use Exception;
class ApiFriendlyException extends Exception {
class ApiFriendlyException extends \BaseException {
public $title;
public $httpResponseCode;

@ -3,7 +3,7 @@
namespace BusinessLogic;
class Helpers {
class Helpers extends \BaseClass {
static function getHeader($key) {
$headers = getallheaders();

@ -3,7 +3,7 @@
namespace BusinessLogic\Navigation;
class CustomNavElement {
class CustomNavElement extends \BaseClass {
/* @var $id int*/
public $id;

@ -6,7 +6,7 @@ namespace BusinessLogic\Navigation;
use BusinessLogic\Exceptions\ApiFriendlyException;
use DataAccess\Navigation\CustomNavElementGateway;
class CustomNavElementHandler {
class CustomNavElementHandler extends \BaseClass {
/* @var $customNavElementGateway CustomNavElementGateway */
private $customNavElementGateway;

@ -3,7 +3,7 @@
namespace BusinessLogic\Navigation;
class CustomNavElementPlace {
class CustomNavElementPlace extends \BaseClass {
const HOMEPAGE_BLOCK = 1;
const CUSTOMER_NAVIGATION = 2;
const ADMIN_NAVIGATION = 3;

@ -3,7 +3,7 @@
namespace BusinessLogic\Navigation;
class Direction {
class Direction extends \BaseClass {
const UP = 'up';
const DOWN = 'down';
}

@ -5,7 +5,7 @@ namespace BusinessLogic\Security;
use DataAccess\Security\BanGateway;
class BanRetriever {
class BanRetriever extends \BaseClass {
/**
* @var BanGateway
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class BannedEmail {
class BannedEmail extends \BaseClass {
/**
* @var int
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class BannedIp {
class BannedIp extends \BaseClass {
/**
* @var int
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class PermissionChecker {
class PermissionChecker extends \BaseClass {
/**
* @param $userContext UserContext
* @param $permission string

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class UserContext {
class UserContext extends \BaseClass {
/* @var $id int */
public $id;

@ -8,7 +8,7 @@ use BusinessLogic\Exceptions\MissingAuthenticationTokenException;
use BusinessLogic\Helpers;
use DataAccess\Security\UserGateway;
class UserContextBuilder {
class UserContextBuilder extends \BaseClass {
/**
* @var UserGateway
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class UserContextNotifications {
class UserContextNotifications extends \BaseClass {
public $newUnassigned;
public $newAssignedToMe;
public $replyUnassigned;

@ -3,7 +3,7 @@
namespace BusinessLogic\Security;
class UserContextPreferences {
class UserContextPreferences extends \BaseClass {
public $afterReply;
public $autoStartTimeWorked;
public $autoreload;

@ -9,7 +9,7 @@
namespace BusinessLogic\Security;
class UserPrivilege {
class UserPrivilege extends \BaseClass {
const CAN_VIEW_TICKETS = 'can_view_tickets';
const CAN_REPLY_TO_TICKETS = 'can_reply_tickets';
const CAN_EDIT_TICKETS = 'can_edit_tickets';

@ -6,7 +6,7 @@ namespace BusinessLogic\Security;
use BusinessLogic\Tickets\Ticket;
use DataAccess\Security\UserGateway;
class UserToTicketChecker {
class UserToTicketChecker extends \BaseClass {
/* @var $userGateway UserGateway */
private $userGateway;

@ -5,7 +5,7 @@ namespace BusinessLogic\Settings;
use DataAccess\Settings\ModsForHeskSettingsGateway;
class ApiChecker {
class ApiChecker extends \BaseClass {
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
private $modsForHeskSettingsGateway;

@ -5,7 +5,7 @@ namespace BusinessLogic\Settings;
// TODO Test!
use DataAccess\Settings\ModsForHeskSettingsGateway;
class SettingsRetriever {
class SettingsRetriever extends \BaseClass {
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
private $modsForHeskSettingsGateway;

@ -3,7 +3,7 @@
namespace BusinessLogic\Statuses;
class Closable {
class Closable extends \BaseClass {
const YES = "yes";
const STAFF_ONLY = "sonly";
const CUSTOMERS_ONLY = "conly";

@ -3,7 +3,7 @@
namespace BusinessLogic\Statuses;
class DefaultStatusForAction {
class DefaultStatusForAction extends \BaseClass {
const NEW_TICKET = "IsNewTicketStatus";
const CLOSED_STATUS = "IsClosed";
const CLOSED_BY_CLIENT = "IsClosedByClient";

@ -3,7 +3,7 @@
namespace BusinessLogic\Statuses;
class Status {
class Status extends \BaseClass {
static function fromDatabase($row, $languageRs) {
$status = new Status();
$status->id = intval($row['ID']);

@ -6,7 +6,7 @@ namespace BusinessLogic\Statuses;
use DataAccess\Statuses\StatusGateway;
// TODO Test!
class StatusRetriever {
class StatusRetriever extends \BaseClass {
/* @var $statusGateway StatusGateway */
private $statusGateway;

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets;
class Attachment {
class Attachment extends \BaseClass {
/**
* @var int
*/

@ -8,7 +8,7 @@ use BusinessLogic\Security\UserPrivilege;
use DataAccess\Categories\CategoryGateway;
use DataAccess\Security\UserGateway;
class Autoassigner {
class Autoassigner extends \BaseClass {
/* @var $categoryGateway CategoryGateway */
private $categoryGateway;

@ -2,7 +2,7 @@
namespace BusinessLogic\Tickets;
class CreateTicketByCustomerModel {
class CreateTicketByCustomerModel extends \BaseClass {
/**
* @var string
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets;
class CreatedTicketModel {
class CreatedTicketModel extends \BaseClass {
/* @var $ticket Ticket */
public $ticket;

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets\CustomFields;
class CustomFieldValidator {
class CustomFieldValidator extends \BaseClass {
static function isCustomFieldInCategory($customFieldId, $categoryId, $staff, $heskSettings) {
$customField = $heskSettings['custom_fields']["custom{$customFieldId}"];

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets;
class EditTicketModel {
class EditTicketModel extends \BaseClass {
/* @var $id int */
public $id;

@ -3,9 +3,7 @@
namespace BusinessLogic\Tickets\Exceptions;
use Exception;
class UnableToGenerateTrackingIdException extends Exception {
class UnableToGenerateTrackingIdException extends \BaseException {
public function __construct() {
parent::__construct("Error generating a unique ticket ID.");
}

@ -10,7 +10,7 @@ use BusinessLogic\ValidationModel;
use BusinessLogic\Validators;
use Core\Constants\CustomField;
class NewTicketValidator {
class NewTicketValidator extends \BaseClass {
/**
* @var $categoryRetriever CategoryRetriever
*/

@ -9,7 +9,7 @@
namespace BusinessLogic\Tickets;
class Reply {
class Reply extends \BaseClass {
/**
* @var $id int
*/

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets;
class Ticket {
class Ticket extends \BaseClass {
static function fromDatabaseRow($row, $linkedTicketsRs, $repliesRs, $heskSettings) {
$ticket = new Ticket();
$ticket->id = intval($row['id']);

@ -12,7 +12,7 @@ use DataAccess\Settings\ModsForHeskSettingsGateway;
use DataAccess\Statuses\StatusGateway;
use DataAccess\Tickets\TicketGateway;
class TicketCreator {
class TicketCreator extends \BaseClass {
/**
* @var $newTicketValidator NewTicketValidator
*/

@ -10,7 +10,7 @@ use BusinessLogic\Security\UserPrivilege;
use BusinessLogic\Security\UserToTicketChecker;
use DataAccess\Tickets\TicketGateway;
class TicketDeleter {
class TicketDeleter extends \BaseClass {
/* @var $ticketGateway TicketGateway */
private $ticketGateway;

@ -15,7 +15,7 @@ use BusinessLogic\Validators;
use Core\Constants\CustomField;
use DataAccess\Tickets\TicketGateway;
class TicketEditor {
class TicketEditor extends \BaseClass {
/* @var $ticketGateway TicketGateway */
private $ticketGateway;

@ -3,7 +3,7 @@
namespace BusinessLogic\Tickets;
class TicketGatewayGeneratedFields {
class TicketGatewayGeneratedFields extends \BaseClass {
public $id;
public $dateCreated;
public $dateModified;

@ -10,7 +10,7 @@ use BusinessLogic\Security\UserToTicketChecker;
use BusinessLogic\ValidationModel;
use DataAccess\Tickets\TicketGateway;
class TicketRetriever {
class TicketRetriever extends \BaseClass {
/**
* @var $ticketGateway TicketGateway
*/

@ -4,7 +4,7 @@ namespace BusinessLogic\Tickets;
use DataAccess\Tickets\TicketGateway;
class TicketValidators {
class TicketValidators extends \BaseClass {
/**
* @var $ticketGateway TicketGateway
*/

@ -6,7 +6,7 @@ namespace BusinessLogic\Tickets;
use BusinessLogic\Tickets\Exceptions\UnableToGenerateTrackingIdException;
use DataAccess\Tickets\TicketGateway;
class TrackingIdGenerator {
class TrackingIdGenerator extends \BaseClass {
/**
* @var $ticketGateway TicketGateway
*/

@ -11,7 +11,7 @@ namespace BusinessLogic\Tickets;
use DataAccess\Tickets\VerifiedEmailGateway;
class VerifiedEmailChecker {
class VerifiedEmailChecker extends \BaseClass {
/**
* @var $verifiedEmailGateway VerifiedEmailGateway
*/

@ -2,7 +2,7 @@
namespace BusinessLogic;
class ValidationModel {
class ValidationModel extends \BaseClass {
/**
* @var array
*/

@ -3,7 +3,7 @@
namespace BusinessLogic;
class Validators {
class Validators extends \BaseClass {
/**
* @param string $address - the email address
* @param array $multiple_emails - true if HESK (or custom field) supports multiple emails

@ -7,7 +7,7 @@ use BusinessLogic\Attachments\Attachment;
use BusinessLogic\Attachments\AttachmentRetriever;
use BusinessLogic\Exceptions\ApiFriendlyException;
class PublicAttachmentController {
class PublicAttachmentController extends \BaseClass {
static function getRaw($trackingId, $attachmentId) {
global $hesk_settings, $applicationContext, $userContext;

@ -11,7 +11,7 @@ use BusinessLogic\Helpers;
use BusinessLogic\Security\UserToTicketChecker;
use Controllers\JsonRetriever;
class StaffTicketAttachmentsController {
class StaffTicketAttachmentsController extends \BaseClass {
function get($ticketId, $attachmentId) {
global $hesk_settings, $applicationContext, $userContext;

@ -9,7 +9,7 @@ use BusinessLogic\Exceptions\ApiFriendlyException;
use BusinessLogic\Helpers;
use Controllers\JsonRetriever;
class CategoryController {
class CategoryController extends \BaseClass {
function get($id) {
$categories = self::getAllCategories();

@ -6,7 +6,7 @@ namespace Controllers;
use BusinessLogic\Exceptions\InternalUseOnlyException;
use BusinessLogic\Helpers;
abstract class InternalApiController {
abstract class InternalApiController extends \BaseClass {
static function staticCheckForInternalUseOnly() {
$tokenHeader = Helpers::getHeader('X-AUTH-TOKEN');
if ($tokenHeader !== null && trim($tokenHeader) !== '') {

@ -3,7 +3,7 @@
namespace Controllers;
class JsonRetriever {
class JsonRetriever extends \BaseClass {
/**
* Support POST, PUT, and PATCH request (and possibly more)
*

@ -5,7 +5,7 @@ namespace Controllers\Settings;
use BusinessLogic\Settings\SettingsRetriever;
class SettingsController {
class SettingsController extends \BaseClass {
function get() {
global $applicationContext, $hesk_settings;

@ -5,7 +5,7 @@ namespace Controllers\Statuses;
use BusinessLogic\Statuses\StatusRetriever;
class StatusController {
class StatusController extends \BaseClass {
function get() {
global $applicationContext, $hesk_settings;

@ -3,7 +3,7 @@
namespace Controllers\System;
class HeskVersionController {
class HeskVersionController extends \BaseClass {
static function getHeskVersion() {
global $hesk_settings;

@ -10,7 +10,7 @@ use BusinessLogic\ValidationModel;
use Controllers\JsonRetriever;
class CustomerTicketController {
class CustomerTicketController extends \BaseClass {
function get() {
global $applicationContext, $hesk_settings;

@ -10,7 +10,7 @@ use BusinessLogic\Tickets\TicketEditor;
use BusinessLogic\Tickets\TicketRetriever;
use Controllers\JsonRetriever;
class StaffTicketController {
class StaffTicketController extends \BaseClass {
function get($id) {
global $applicationContext, $userContext, $hesk_settings;

@ -3,7 +3,7 @@
namespace Core\Constants;
class CustomField {
class CustomField extends \BaseClass {
const RADIO = 'radio';
const SELECT = 'select';
const CHECKBOX = 'checkbox';

@ -3,7 +3,7 @@
namespace Core\Constants;
class Priority {
class Priority extends \BaseClass {
const CRITICAL = 0;
const HIGH = 1;
const MEDIUM = 2;

@ -2,9 +2,7 @@
namespace Core\Exceptions;
use Exception;
class SQLException extends Exception {
class SQLException extends \BaseException {
/**
* @var $failingQuery string
*/

@ -5,7 +5,7 @@ namespace DataAccess;
use Exception;
class CommonDao {
class CommonDao extends \BaseClass {
/**
* @throws Exception if the database isn't properly configured
*/

@ -3,9 +3,7 @@
namespace DataAccess\Files;
use BusinessLogic\Exceptions\ApiFriendlyException;
class FileDeleter {
class FileDeleter extends \BaseClass {
function deleteFile($name, $folder) {
$path = __DIR__ . "/../../../{$folder}/{$name}";
if (!file_exists($path)) {

@ -5,7 +5,7 @@ namespace DataAccess\Files;
use BusinessLogic\Exceptions\ApiFriendlyException;
class FileReader {
class FileReader extends \BaseClass {
/**
* @param $name string - The file name (including extension)
* @param $folder - The folder name (relative to the ROOT of the helpdesk)

@ -3,7 +3,7 @@
namespace DataAccess\Files;
class FileWriter {
class FileWriter extends \BaseClass {
/**
* @param $name string - The file name (including extension)
* @param $folder - The folder name (relative to the ROOT of the helpdesk)

@ -3,7 +3,7 @@
namespace DataAccess\Logging;
class Severity {
class Severity extends \BaseClass {
const DEBUG = 0;
const INFO = 1;
const WARNING = 2;

@ -42,7 +42,7 @@ class Link
self::$routes = $routes;
$method = self::getRequestMethod();
$acceptedMethods = RequestMethod::ALL;
$acceptedMethods = RequestMethod::all();
$path = '/';
$handler = null;
$matched = array();

@ -50,7 +50,7 @@ function assertApiIsEnabled() {
global $applicationContext, $hesk_settings;
/* @var $apiChecker \BusinessLogic\Settings\ApiChecker */
$apiChecker = $applicationContext->get(\BusinessLogic\Settings\ApiChecker::class);
$apiChecker = $applicationContext->get(\BusinessLogic\Settings\ApiChecker::clazz());
if (!$apiChecker->isApiEnabled($hesk_settings)) {
print output(array('message' => 'API Disabled'), 404);
@ -77,7 +77,7 @@ function buildUserContext($xAuthToken) {
global $applicationContext, $userContext, $hesk_settings;
/* @var $userContextBuilder \BusinessLogic\Security\UserContextBuilder */
$userContextBuilder = $applicationContext->get(\BusinessLogic\Security\UserContextBuilder::class);
$userContextBuilder = $applicationContext->get(\BusinessLogic\Security\UserContextBuilder::clazz());
$userContext = $userContextBuilder->buildUserContext($xAuthToken, $hesk_settings);
}
@ -98,12 +98,12 @@ function exceptionHandler($exception) {
}
// We don't cast API Friendly Exceptions as they're user-generated errors
if (exceptionIsOfType($exception, \BusinessLogic\Exceptions\ApiFriendlyException::class)) {
if (exceptionIsOfType($exception, \BusinessLogic\Exceptions\ApiFriendlyException::clazz())) {
/* @var $castedException \BusinessLogic\Exceptions\ApiFriendlyException */
$castedException = $exception;
print_error($castedException->title, $castedException->getMessage(), $castedException->httpResponseCode);
} elseif (exceptionIsOfType($exception, \Core\Exceptions\SQLException::class)) {
} elseif (exceptionIsOfType($exception, \Core\Exceptions\SQLException::clazz())) {
/* @var $castedException \Core\Exceptions\SQLException */
$castedException = $exception;
@ -138,7 +138,7 @@ function tryToLog($location, $message, $stackTrace, $userContext, $heskSettings)
global $applicationContext;
/* @var $loggingGateway \DataAccess\Logging\LoggingGateway */
$loggingGateway = $applicationContext->get(\DataAccess\Logging\LoggingGateway::class);
$loggingGateway = $applicationContext->get(\DataAccess\Logging\LoggingGateway::clazz());
try {
return $loggingGateway->logError($location, $message, $stackTrace, $userContext, $heskSettings);
@ -183,41 +183,41 @@ Link::before('globalBefore');
Link::all(array(
// Categories
'/v1/categories/all' => action(\Controllers\Categories\CategoryController::class . '::printAllCategories', [RequestMethod::GET], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1/categories' => action(\Controllers\Categories\CategoryController::class, [RequestMethod::POST], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1/categories/{i}' => action(\Controllers\Categories\CategoryController::class, [RequestMethod::GET, RequestMethod::PUT, RequestMethod::DELETE], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1-internal/categories/{i}/sort/{s}' => action(\Controllers\Categories\CategoryController::class . '::sort', [RequestMethod::POST], SecurityHandler::INTERNAL),
'/v1/categories/all' => action(\Controllers\Categories\CategoryController::clazz() . '::printAllCategories', [RequestMethod::GET], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1/categories' => action(\Controllers\Categories\CategoryController::clazz(), [RequestMethod::POST], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1/categories/{i}' => action(\Controllers\Categories\CategoryController::clazz(), [RequestMethod::GET, RequestMethod::PUT, RequestMethod::DELETE], SecurityHandler::INTERNAL_OR_AUTH_TOKEN),
'/v1-internal/categories/{i}/sort/{s}' => action(\Controllers\Categories\CategoryController::clazz() . '::sort', [RequestMethod::POST], SecurityHandler::INTERNAL),
// Tickets
'/v1/tickets' => action(\Controllers\Tickets\CustomerTicketController::class, RequestMethod::all()),
'/v1/tickets' => action(\Controllers\Tickets\CustomerTicketController::clazz(), RequestMethod::all()),
// Tickets - Staff
'/v1/staff/tickets/{i}' => action(\Controllers\Tickets\StaffTicketController::class, RequestMethod::all()),
'/v1/staff/tickets/{i}' => action(\Controllers\Tickets\StaffTicketController::clazz(), RequestMethod::all()),
// Attachments
'/v1/tickets/{a}/attachments/{i}' => action(\Controllers\Attachments\PublicAttachmentController::class . '::getRaw', RequestMethod::all()),
'/v1/staff/tickets/{i}/attachments' => action(\Controllers\Attachments\StaffTicketAttachmentsController::class, RequestMethod::all()),
'/v1/staff/tickets/{i}/attachments/{i}' => action(\Controllers\Attachments\StaffTicketAttachmentsController::class, RequestMethod::all()),
'/v1/tickets/{a}/attachments/{i}' => action(\Controllers\Attachments\PublicAttachmentController::clazz() . '::getRaw', RequestMethod::all()),
'/v1/staff/tickets/{i}/attachments' => action(\Controllers\Attachments\StaffTicketAttachmentsController::clazz(), RequestMethod::all()),
'/v1/staff/tickets/{i}/attachments/{i}' => action(\Controllers\Attachments\StaffTicketAttachmentsController::clazz(), RequestMethod::all()),
// Statuses
'/v1/statuses' => action(\Controllers\Statuses\StatusController::class, RequestMethod::all()),
'/v1/statuses' => action(\Controllers\Statuses\StatusController::clazz(), RequestMethod::all()),
// Settings
'/v1/settings' => action(\Controllers\Settings\SettingsController::class, RequestMethod::all()),
'/v1/settings' => action(\Controllers\Settings\SettingsController::clazz(), RequestMethod::all()),
/* Internal use only routes */
// Resend email response
'/v1-internal/staff/tickets/{i}/resend-email' =>
action(\Controllers\Tickets\ResendTicketEmailToCustomerController::class, RequestMethod::all(), SecurityHandler::INTERNAL),
action(\Controllers\Tickets\ResendTicketEmailToCustomerController::clazz(), RequestMethod::all(), SecurityHandler::INTERNAL),
// Custom Navigation
'/v1-internal/custom-navigation/all' =>
action(\Controllers\Navigation\CustomNavElementController::class . '::getAll', RequestMethod::all(), SecurityHandler::INTERNAL),
action(\Controllers\Navigation\CustomNavElementController::clazz() . '::getAll', RequestMethod::all(), SecurityHandler::INTERNAL),
'/v1-internal/custom-navigation' =>
action(\Controllers\Navigation\CustomNavElementController::class, RequestMethod::all(), SecurityHandler::INTERNAL),
action(\Controllers\Navigation\CustomNavElementController::clazz(), RequestMethod::all(), SecurityHandler::INTERNAL),
'/v1-internal/custom-navigation/{i}' =>
action(\Controllers\Navigation\CustomNavElementController::class, RequestMethod::all(), SecurityHandler::INTERNAL),
action(\Controllers\Navigation\CustomNavElementController::clazz(), RequestMethod::all(), SecurityHandler::INTERNAL),
'/v1-internal/custom-navigation/{i}/sort/{s}' =>
action(\Controllers\Navigation\CustomNavElementController::class . '::sort', RequestMethod::all(), SecurityHandler::INTERNAL),
action(\Controllers\Navigation\CustomNavElementController::clazz() . '::sort', RequestMethod::all(), SecurityHandler::INTERNAL),
'/v1-public/hesk-version' =>
action(\Controllers\System\HeskVersionController::class . '::getHeskVersion', RequestMethod::all(), SecurityHandler::OPEN),
action(\Controllers\System\HeskVersionController::clazz() . '::getHeskVersion', RequestMethod::all(), SecurityHandler::OPEN),
'/v1-public/mods-for-hesk-version' =>
action(\Controllers\System\HeskVersionController::class . '::getModsForHeskVersion', RequestMethod::all(), SecurityHandler::OPEN),
action(\Controllers\System\HeskVersionController::clazz() . '::getModsForHeskVersion', RequestMethod::all(), SecurityHandler::OPEN),
// Any URL that doesn't match goes to the 404 handler
'404' => 'handle404'

Loading…
Cancel
Save