-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
56 lines (46 loc) · 1.66 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Entry point for the MiniPavi Web Server
*/
// Global configuration, autoloaders and ou mb_ucfirst() function
require_once "services/global-config.php";
require_once "src/service_autoloader.php";
require_once "vendor/autoload.php";
require_once "src/helpers/mb_ucfirst.php";
use MiniPavi\MiniPaviCli;
use \MiniPaviFwk\helpers\ConstantHelper;
use \MiniPaviFwk\handlers\ServiceHandler;
try {
MiniPaviCli::start();
// Start Session
$session_handler = ConstantHelper::getConstValueByName(
'SESSION_HANDLER_CLASSNAME',
\MiniPaviFwk\handlers\SessionHandler::class
);
$session_handler::startSession();
// Start Service
$service_handler = ConstantHelper::getConstValueByName(
'SERVICE_HANDLER_CLASSNAME',
ServiceHandler::class
);
$service_handler::startService();
// Execute the query
// Many informations returned to enable wrapping by the Service optional Query Handler
$query_handler = $service_handler::getQueryHandler();
list($action, $controller, $cmd, $context, $output, $nextPage) = $query_handler::queryLogic();
// Support Direct Call the right way
list($action, $controller, $cmd, $context, $output, $nextPage, $directCall) = $query_handler::directCall(
$action,
$controller,
$cmd,
$context,
$output,
$nextPage
);
// Ends saving session and returning command
$session_handler::setContext($context);
MiniPaviCli::send($output, $nextPage, $session_handler::getMiniPaviContext(), true, $cmd, $directCall);
} catch (Exception $e) {
throw new Exception('Erreur MiniPavi ' . $e->getMessage());
}
trigger_error("fin");