functions and classes added.
This commit is contained in:
		
							parent
							
								
									0c41ca9b65
								
							
						
					
					
						commit
						28513d367d
					
				@ -2,71 +2,74 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class Database {
 | 
					class Database {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private $host;
 | 
					 | 
				
			||||||
    private $user;
 | 
					 | 
				
			||||||
    private $pass;
 | 
					 | 
				
			||||||
    private $dbname;
 | 
					 | 
				
			||||||
    private $conn;
 | 
					    private $conn;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function __construct($dbinfo) {
 | 
					    public function __construct($dbinfo) {
 | 
				
			||||||
        $this->host = $dbinfo['host'];
 | 
					        $this->conn = new mysqli($dbinfo['host'], $dbinfo['user'], $dbinfo['pass'], $dbinfo['name']);
 | 
				
			||||||
        $this->user = $dbinfo['user'];
 | 
					 | 
				
			||||||
        $this->pass = $dbinfo['pass'];
 | 
					 | 
				
			||||||
        $this->dbname = $dbinfo['name'];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $this->connect();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private function connect() {
 | 
					 | 
				
			||||||
        $this->conn = new mysqli($this->host, $this->user, $this->pass, $this->dbname);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if ($this->conn->connect_error) {
 | 
					        if ($this->conn->connect_error) {
 | 
				
			||||||
            die("Connection failed: " . $this->conn->connect_error);
 | 
					            die("Connection failed: " . $this->conn->connect_error);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function query($query) {
 | 
					    public function query($query, $params = []) {
 | 
				
			||||||
        $stmt = $this->conn->prepare($query);
 | 
					        // Prepare the SQL query
 | 
				
			||||||
        $stmt->execute();
 | 
					        if ($stmt = $this->conn->prepare($query)) {
 | 
				
			||||||
 | 
					            // Bind parameters to the prepared statement (if any)
 | 
				
			||||||
        return $stmt->get_result();
 | 
					            if (!empty($params)) {
 | 
				
			||||||
 | 
					                $types = str_repeat('s', count($params)); // Assuming all params are strings
 | 
				
			||||||
 | 
					                $stmt->bind_param($types, ...$params);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public function getRow($query) {
 | 
					            // Execute the statement
 | 
				
			||||||
        $result = $this->query($query);
 | 
					            if (!$stmt->execute()) {
 | 
				
			||||||
 | 
					                throw new Exception("Query execution failed: " . $stmt->error);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					            // Return the statement result
 | 
				
			||||||
 | 
					            return $stmt;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            throw new Exception("Query preparation failed: " . $this->conn->error);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function getRow($query, $params = []) {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            // Perform the query using prepared statement
 | 
				
			||||||
 | 
					            $stmt = $this->query($query, $params);
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					            // Get the result of the query
 | 
				
			||||||
 | 
					            $result = $stmt->get_result();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					            // Fetch the first row from the result
 | 
				
			||||||
            return $result->fetch_assoc();
 | 
					            return $result->fetch_assoc();
 | 
				
			||||||
 | 
					        } catch (Exception $e) {
 | 
				
			||||||
 | 
					            // Handle the exception (log it, display a message, etc.)
 | 
				
			||||||
 | 
					            echo "An error occurred: " . $e->getMessage();
 | 
				
			||||||
 | 
					            return null;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function debugGetRow($query) {
 | 
					    public function getRows($query, $params = []) {
 | 
				
			||||||
        echo "<h1>Debug GetRow Query</h1>";
 | 
					        $stmt = $this->conn->prepare($query);
 | 
				
			||||||
        echo "<div class='debug-query'>Query: $query</div>";
 | 
					        if (!$stmt) {
 | 
				
			||||||
        $result = $this->query($query);
 | 
					            die("Query preparation failed: " . $this->conn->error);
 | 
				
			||||||
        $row = $result->fetch_assoc();
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        echo "<pre>";
 | 
					 | 
				
			||||||
        print_r($row);
 | 
					 | 
				
			||||||
        echo "</pre>";
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        die();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public function getRows($query) {
 | 
					        // Bind parameters if provided
 | 
				
			||||||
        $result = $this->query($query);
 | 
					        if (!empty($params)) {
 | 
				
			||||||
 | 
					            $types = str_repeat('s', count($params)); // Assuming all are strings, adjust as needed
 | 
				
			||||||
 | 
					            $stmt->bind_param($types, ...$params);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					        $stmt->execute();
 | 
				
			||||||
 | 
					        $result = $stmt->get_result(); // Requires MySQL Native Driver (mysqlnd)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					        if ($result) {
 | 
				
			||||||
            return $result->fetch_all(MYSQLI_ASSOC);
 | 
					            return $result->fetch_all(MYSQLI_ASSOC);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            return [];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function debugGetRows($query) {
 | 
					 | 
				
			||||||
        echo "<h1>Debug GetRows Query</h1>";
 | 
					 | 
				
			||||||
        echo "<div class='debug-query'>Query: $query</div>";
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        $result = $this->query($query);
 | 
					 | 
				
			||||||
        $rows = $result->fetch_all(MYSQLI_ASSOC);
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        echo "<pre>";
 | 
					 | 
				
			||||||
        print_r($rows);
 | 
					 | 
				
			||||||
        echo "</pre>";
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        die();
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function close() {
 | 
					    public function close() {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										62
									
								
								src/MessageHandler.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								src/MessageHandler.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class MessageHandler {
 | 
				
			||||||
 | 
					    private $messages = [
 | 
				
			||||||
 | 
					        'error' => [],
 | 
				
			||||||
 | 
					        'warning' => [],
 | 
				
			||||||
 | 
					        'notice' => [],
 | 
				
			||||||
 | 
					        'success' => []
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Add a message of a specific type
 | 
				
			||||||
 | 
					    public function addMessage($type, $message) {
 | 
				
			||||||
 | 
					        if (!isset($this->messages[$type])) {
 | 
				
			||||||
 | 
					            throw new Exception("Invalid message type: $type");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        $this->messages[$type][] = $message;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get all messages of a specific type
 | 
				
			||||||
 | 
					    public function getMessages($type) {
 | 
				
			||||||
 | 
					        return $this->messages[$type] ?? [];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get all messages of all types
 | 
				
			||||||
 | 
					    public function getAllMessages() {
 | 
				
			||||||
 | 
					        return $this->messages;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get the count of messages for a specific type
 | 
				
			||||||
 | 
					    public function count($type) {
 | 
				
			||||||
 | 
					        return isset($this->messages[$type]) ? count($this->messages[$type]) : 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get the total count of all messages
 | 
				
			||||||
 | 
					    public function totalCount() {
 | 
				
			||||||
 | 
					        return array_sum(array_map('count', $this->messages));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check if there are any messages of a specific type
 | 
				
			||||||
 | 
					    public function hasMessages($type) {
 | 
				
			||||||
 | 
					        return !empty($this->messages[$type]);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check if there are any messages at all
 | 
				
			||||||
 | 
					    public function hasAnyMessages() {
 | 
				
			||||||
 | 
					        return $this->totalCount() > 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Clear messages of a specific type
 | 
				
			||||||
 | 
					    public function clear($type) {
 | 
				
			||||||
 | 
					        if (isset($this->messages[$type])) {
 | 
				
			||||||
 | 
					            $this->messages[$type] = [];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Clear all messages
 | 
				
			||||||
 | 
					    public function clearAll() {
 | 
				
			||||||
 | 
					        foreach ($this->messages as $type => $list) {
 | 
				
			||||||
 | 
					            $this->messages[$type] = [];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										25
									
								
								src/Post.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/Post.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Post {
 | 
				
			||||||
 | 
					    private $data = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function __construct($post) {
 | 
				
			||||||
 | 
					        $this->sanitize($post);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private function sanitize($post) {
 | 
				
			||||||
 | 
					        foreach ($post as $key => $value) {
 | 
				
			||||||
 | 
					            $this->data[$key] = is_array($value) 
 | 
				
			||||||
 | 
					                ? filter_var_array($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS) 
 | 
				
			||||||
 | 
					                : filter_var($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function get($key, $default = null) {
 | 
				
			||||||
 | 
					        return $this->data[$key] ?? $default;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function all() {
 | 
				
			||||||
 | 
					        return $this->data;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										40
									
								
								src/Redirect.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								src/Redirect.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Use 
 | 
				
			||||||
 | 
					 * $redirect->to('/login');
 | 
				
			||||||
 | 
					 * to trigger a redirect
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Redirect {
 | 
				
			||||||
 | 
					    private ?string $url = null;
 | 
				
			||||||
 | 
					    private int $statusCode = 303;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function url(string $relativeUrl, int $statusCode = 303): void {
 | 
				
			||||||
 | 
					        $this->statusCode = $statusCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Detect HTTPS
 | 
				
			||||||
 | 
					        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Get Hostname
 | 
				
			||||||
 | 
					        $host = $_SERVER['HTTP_HOST'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Get Base Directory
 | 
				
			||||||
 | 
					        $basePath = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Construct Absolute URL
 | 
				
			||||||
 | 
					        $this->url = "$protocol://$host$basePath/" . ltrim($relativeUrl, '/');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function isset(): bool {
 | 
				
			||||||
 | 
					        return !is_null($this->url);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function execute(): void {
 | 
				
			||||||
 | 
					        if ($this->url) {
 | 
				
			||||||
 | 
					            header("Location: " . $this->url, true, $this->statusCode);
 | 
				
			||||||
 | 
					            exit();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -119,19 +119,16 @@ class Router {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function debug() {
 | 
					    public function debug() {
 | 
				
			||||||
        echo '<h1>Debugging Router</h1>';
 | 
					        echo '<div id="router-debug-container" class="debug">';
 | 
				
			||||||
        echo '<h2>Url Path</h2>';
 | 
					        echo '<table border="1" cellpadding="10" cellspacing="0">';
 | 
				
			||||||
        echo $this->path . '<br>';
 | 
					        echo '<tr><th>Url Path</th><td>' . htmlspecialchars($this->path) . '</td></tr>';
 | 
				
			||||||
        echo '<h2>ControllerPath</h2>';
 | 
					        echo '<tr><th>Controller Path</th><td>' . htmlspecialchars($this->controllerPath) . '</td></tr>';
 | 
				
			||||||
        echo $this->controllerPath;
 | 
					        echo '<tr><th>Parameters</th><td><pre>' . print_r($this->parameters, true) . '</pre></td></tr>';
 | 
				
			||||||
        echo '<h2>Parameters</h2>';
 | 
					        echo '<tr><th>Routes</th><td><pre>' . print_r($this->routes, true) . '</pre></td></tr>';
 | 
				
			||||||
        echo '<pre>';
 | 
					        echo '</table></div>';
 | 
				
			||||||
        print_r($this->parameters);
 | 
					    
 | 
				
			||||||
        echo '</pre>';
 | 
					 | 
				
			||||||
        echo '<h2>Routes Variable</h2><pre>';
 | 
					 | 
				
			||||||
        print_r($this->routes);
 | 
					 | 
				
			||||||
        echo '</pre>';
 | 
					 | 
				
			||||||
        die();
 | 
					        die();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -4,13 +4,15 @@ class Session {
 | 
				
			|||||||
    private $session;
 | 
					    private $session;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function __construct() {
 | 
					    public function __construct() {
 | 
				
			||||||
        if (!isset($_SESSION)) {
 | 
					 | 
				
			||||||
        session_start();
 | 
					        session_start();
 | 
				
			||||||
 | 
					        if (!isset($_SESSION)) {
 | 
				
			||||||
            $this->session = $_SESSION;
 | 
					            $this->session = $_SESSION;
 | 
				
			||||||
 | 
					            $this->setToken();
 | 
				
			||||||
 | 
					            $this->session['messages'] = [];
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $this->session = $_SESSION;
 | 
					            $this->session = $_SESSION;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        $this->setToken();
 | 
					        
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function setToken() {
 | 
					    public function setToken() {
 | 
				
			||||||
@ -34,7 +36,7 @@ class Session {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function debug() {
 | 
					    public function debug() {
 | 
				
			||||||
        print_r($this->session);
 | 
					        return $this->session;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function delete($key) {
 | 
					    public function delete($key) {
 | 
				
			||||||
@ -48,4 +50,8 @@ class Session {
 | 
				
			|||||||
        session_write_close();
 | 
					        session_write_close();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function kill() {
 | 
				
			||||||
 | 
					        session_destroy();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										29
									
								
								src/functions.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/functions.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Dump and Die
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					function dd(...$vars) {
 | 
				
			||||||
 | 
					    echo "<pre style='background:#222;color:#0f0;padding:10px;border-radius:5px;'>";
 | 
				
			||||||
 | 
					    foreach ($vars as $var) {
 | 
				
			||||||
 | 
					        var_dump($var);
 | 
				
			||||||
 | 
					        echo "\n";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    echo "</pre>";
 | 
				
			||||||
 | 
					    die();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function makeitso() {
 | 
				
			||||||
 | 
					    global $session, $db, $redirect, $config, $messages;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!empty($config['database']['host'])) {
 | 
				
			||||||
 | 
					        $db->close();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $session->set('messages', $messages->getAllMessages());
 | 
				
			||||||
 | 
					    $session->write();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $redirect->execute();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    exit();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -10,9 +10,16 @@ if (file_exists(BASEPATH . '/App/config.php')) {
 | 
				
			|||||||
    require_once(FRAMEWORKPATH . '/defaults/App/config.php');
 | 
					    require_once(FRAMEWORKPATH . '/defaults/App/config.php');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Creates twig and the view() function
 | 
					// Global Functions
 | 
				
			||||||
 | 
					require_once(FRAMEWORKPATH . '/src/functions.php');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Creates the view() function using twig
 | 
				
			||||||
require_once(FRAMEWORKPATH . '/src/twig.php');
 | 
					require_once(FRAMEWORKPATH . '/src/twig.php');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Messages
 | 
				
			||||||
 | 
					require_once(FRAMEWORKPATH . '/src/MessageHandler.php');
 | 
				
			||||||
 | 
					$messages = new MessageHandler;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Start a Session
 | 
					// Start a Session
 | 
				
			||||||
require_once(FRAMEWORKPATH . '/src/Session.php');
 | 
					require_once(FRAMEWORKPATH . '/src/Session.php');
 | 
				
			||||||
$session = new Session();
 | 
					$session = new Session();
 | 
				
			||||||
@ -23,11 +30,20 @@ if (!empty($config['database']['host'])) {
 | 
				
			|||||||
    $db = new Database($config['database']);
 | 
					    $db = new Database($config['database']);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Sanatize POST Data
 | 
				
			||||||
 | 
					if (!empty($_POST)) {
 | 
				
			||||||
 | 
					    require_once(FRAMEWORKPATH . '/src/Post.php');
 | 
				
			||||||
 | 
					    $post = new POST($_POST);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Start a Redirect
 | 
				
			||||||
 | 
					require_once(FRAMEWORKPATH . '/src/Redirect.php');
 | 
				
			||||||
 | 
					$redirect = new Redirect();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Load a controller
 | 
					// Load a controller
 | 
				
			||||||
require_once(FRAMEWORKPATH . '/src/Router.php');
 | 
					require_once(FRAMEWORKPATH . '/src/Router.php');
 | 
				
			||||||
$router = new Router();
 | 
					$router = new Router();
 | 
				
			||||||
//$router->debug();
 | 
					//$router->debug();
 | 
				
			||||||
require_once($router->controllerPath);
 | 
					require_once($router->controllerPath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//write the session
 | 
					makeitso();
 | 
				
			||||||
$session->write();
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user