-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
52 lines (39 loc) · 1.25 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
<?php
/**
* PLACIDO-SHOP FRAMEWORK - FRONT
* Copyright © Raphaël Castello, 2019-2024
* Organisation: SNS - Web et informatique
* Website / contact: https://sns.pm
*
* Script name: index.php
*
* ENTRY POINT FOR APPLICATION
*
*/
// ERROR REPORTING :
// E_ALL -> Report all PHP errors | 0 -> Turn off error reporting
error_reporting(0);
// include MUSTACHE
require 'Mustache/Autoloader.php';
Mustache_Autoloader::register();
// CALL CLASSES by spl_autoload_register()
spl_autoload_register(function($class){
// load API classes
$path_API = 'API/' . $class . '.php';
// load PHP application classes
$path_PHP_front = 'PHP/' . $class . '.php';
if( file_exists($path_API) ) require $path_API;
if( file_exists($path_PHP_front) ) require $path_PHP_front;
});
// load constants for API from API/constants.php for all scripts include back-end
api::init_settings();
// public static ARRAY translation
// access translate like this : tr::$TR['my_translation_key']
tr::init_tr( 'front' );
// DEFINE TIMEZONE - returned by api::
date_default_timezone_set( TIMEZONE );
// init modules after translation -> this override tr::$TR[...]
api::init_modules( $context='front' );
// START CONTROLLER
control::start();
?>