Example #1
0
function main()
{
    DatabaseProvider::connect("app/config/database.json");
    $router = new \SFramework\Routing\Router();
    $router->add('/errors/err404', new \app\controllers\ErrorsController(), 'err404');
    $router->add('/update', new \app\controllers\UpdaterController(), 'update');
    $router->add('/view/p', new \app\controllers\HomeController(), 'index');
    $router->add('/planning/get', new \app\controllers\HomeController(), 'getPlanning');
    $router->add('/', new \app\controllers\HomeController(), 'index');
    $router->matchCurrentRequest();
}
Example #2
0
function main()
{
    DatabaseProvider::connect("app/config/database.json");
    $router = new \SFramework\Routing\Router();
    $router->add('/errors/err404', new \app\controllers\ErrorsController(), 'err404');
    $router->add('/image/view', new \app\controllers\HomeController(), 'view');
    $router->add('/image/get', new \app\controllers\HomeController(), 'getImage');
    $router->add('/image/delete', new \app\controllers\HomeController(), 'deleteImage');
    $router->add('/upload', new \app\controllers\HomeController(), 'upload', 'POST');
    $router->add('/register', new \app\controllers\HomeController(), 'register', 'POST');
    $router->add('/users/admin', new \app\controllers\HomeController(), 'admin');
    $router->add('/users/exist', new \app\controllers\HomeController(), 'doesUserExist');
    $router->add('/users/connect', new \app\controllers\HomeController(), 'connect', 'POST');
    $router->add('/users/disconnect', new \app\controllers\HomeController(), 'disconnect');
    $router->add('/users/getimages', new \app\controllers\HomeController(), 'getImages');
    $router->add('/check', new \app\controllers\HomeController(), 'check');
    $router->add('/about', new \app\controllers\HomeController(), 'about');
    $router->add('/partners', new \app\controllers\HomeController(), 'partners');
    $router->add('/', new \app\controllers\HomeController(), 'index');
    $router->matchCurrentRequest();
}