Example #1
0
use Core\Database;
session_start();
//Set up composer autoloader
require "../vendor/autoload.php";
//Set up autoloader which uses namespaces as directory names, starting from the 'app' directory
spl_autoload_register(autoload);
function autoload($class)
{
    $filename = ".." . DIRECTORY_SEPARATOR . "app" . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
    include_once $filename;
}
//Database connection Setttings
Database::config(getenv('IP'), getenv('C9_USER'), "", "c9");
//Start the routing process
//Add any URI Aliases
Route::addAlias(['/login' => '/Auth/Login', '/logout' => '/Auth/Logout', '/signup' => '/Auth/Signup', '/' => 'StaticPage/Home', '' => 'StaticPage/Home']);
Route::route($_SERVER['REQUEST_URI']);
//Actually start the route
//Put test code below
/*
echo "TEST UPDATE";
$usr = new Model\User(1);
print_r($usr);
$usr->fname = "LOLOLOL";
$usr->save();
print_r($usr);

echo "TEST INSERT";
$usr = new Model\User;
$usr->fname = "Test";
$usr->lname = "Foo";