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 static $mvcController;
public static $viewData = [];
function MVCController(){
function __construct(){
self::$mvcController = $this;
//prepare current view and view model
if(isset($_GET['p']) && $_GET['p'] != ''){

View File

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

View File

@ -3,45 +3,11 @@ error_reporting(E_ALL);
ini_set('log_errors','1');
ini_set('display_errors','0');
define('ROOT_DIR', __DIR__);
register_shutdown_function(function() {
$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);
} */
});
session_start();
require_once(ROOT_DIR.'/model/testactions/TestAction.php');
//date_default_timezone_set('Europe/Amsterdam');
require_once(ROOT_DIR.'/controller/MVCController.php');
require_once(ROOT_DIR.'/controller/UserSession.php');
session_start();
$mvcController = new MVCController();
$mvcController->executeModel();
if(!isset($_POST['testaction'])){

View File

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