-
Notifications
You must be signed in to change notification settings - Fork 2
index
Viames Marino edited this page Sep 21, 2018
·
4 revisions
This is the only access point of the project, as foreseen by the monolithic application architecture. This file provides for the initialization of the framework, the possible start up of the API functions, the management of user sessions, the loading of any shared libraries and finally the start of the module according to the Model-View-Controller schema.
The following code allows to specify a module by its name that could be run by outside the authenticated area. Name of the module is cronjob
in the example.
// guest module
$app->setGuestModule('cronjob');
A classic start file to start a Pair application contains the following lines:
<?php
// initialize composer
require 'vendor/autoload.php';
// initialize project classes
require 'classes/classLoader.php';
// start the Application
$app = Pair\Application::getInstance();
// any API requests
$app->runApi('api');
// any session
$app->manageSession();
// start controller and then display
$app->startMvc();