tidying up

This commit is contained in:
Andreas 2019-09-23 14:12:52 +02:00
parent 0a9430490c
commit d07692af94
4 changed files with 3 additions and 38 deletions

View File

@ -8,7 +8,7 @@ class MVCController{
private $timesOverridden = 0; private $timesOverridden = 0;
private static $mvcController; private static $mvcController;
public static $viewData = []; public static $viewData = [];
function MVCController(){ function __construct(){
self::$mvcController = $this; self::$mvcController = $this;
//prepare current view and view model //prepare current view and view model
if(isset($_GET['p']) && $_GET['p'] != ''){ if(isset($_GET['p']) && $_GET['p'] != ''){

View File

@ -5,7 +5,7 @@ Class UserSession{
public $token = "undefined"; public $token = "undefined";
public $expires; public $expires;
public static $session; public static $session;
public function UserSession($uid, $token = "undefined"){ public function __construct($uid, $token = "undefined"){
$this->uid = $uid; $this->uid = $uid;
$this->token = $token; $this->token = $token;
$this->setExpiry(); $this->setExpiry();

View File

@ -3,45 +3,11 @@ error_reporting(E_ALL);
ini_set('log_errors','1'); ini_set('log_errors','1');
ini_set('display_errors','0'); ini_set('display_errors','0');
define('ROOT_DIR', __DIR__); define('ROOT_DIR', __DIR__);
register_shutdown_function(function() { session_start();
$error = error_get_last();
switch($error['type']){
case E_ERROR:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
case E_PARSE:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
case E_CORE_ERROR:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
case E_COMPILE_ERROR:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
case E_USER_ERROR:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
case E_RECOVERABLE_ERROR:
http_response_code(500);
header('HTTP/1.1 500 Internal Server Error');
break;
}
/* if ($error['type'] == E_ERROR || $error['type'] == E_PARSE || $error['type'] == E_CORE_ERROR || $error['type'] == E_COMPILE_ERROR || $error['type'] == E_RECOVERABLE_ERROR) {
header('HTTP/1.1 500 Internal Server Error');
http_response_code(500);
} */
});
require_once(ROOT_DIR.'/model/testactions/TestAction.php'); require_once(ROOT_DIR.'/model/testactions/TestAction.php');
//date_default_timezone_set('Europe/Amsterdam'); //date_default_timezone_set('Europe/Amsterdam');
require_once(ROOT_DIR.'/controller/MVCController.php'); require_once(ROOT_DIR.'/controller/MVCController.php');
require_once(ROOT_DIR.'/controller/UserSession.php'); require_once(ROOT_DIR.'/controller/UserSession.php');
session_start();
$mvcController = new MVCController(); $mvcController = new MVCController();
$mvcController->executeModel(); $mvcController->executeModel();
if(!isset($_POST['testaction'])){ if(!isset($_POST['testaction'])){

View File

@ -1,6 +1,5 @@
<?php <?php
class TA_CreateDB extends TestAction{ class TA_CreateDB extends TestAction{
nee
function TA_CreateDB(){ function TA_CreateDB(){
parent::__construct(); parent::__construct();