<?php
echo "Begin bootstrap\n";

//define class autoloader
spl_autoload_register(function($className){
    $paths=array(
        'classes/',
        'classes/core/',
        'classes/core/exception/',
        'classes/core/authentication/',
        'classes/core/interface/',
        'classes/model/',
        'classes/device/',
    );
    foreach($paths as $path){
        $filePath=__DIR__.'/../'.$path.$className.'.class.php';
        if(file_exists($filePath)){
			include_once($filePath);
        }
    }
});

//connect to the database
database::connect();

echo "End bootstrap\n";
