-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
41 lines (35 loc) · 1.11 KB
/
Copy pathindex.php
File metadata and controls
41 lines (35 loc) · 1.11 KB
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
<?php
/**
* Hackorama - Local Shoporama Development Framework
* Main entry point
*/
// Load configuration
$config = require __DIR__ . '/setup.php';
// Set error reporting - suppress deprecation warnings and notices
if ($config['debug']['enabled']) {
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
ini_set('display_errors', $config['debug']['show_errors'] ? 1 : 0);
} else {
error_reporting(0);
ini_set('display_errors', 0);
}
// No need for sessions - using cookies and JSON files instead
// Include required files
require_once __DIR__ . '/src/Core/Autoloader.php';
// Initialize autoloader
$autoloader = new \Hackorama\Core\Autoloader();
$autoloader->register();
// Initialize Hackorama
try {
$hackorama = new \Hackorama\Core\Hackorama($config);
$hackorama->run();
} catch (Exception $e) {
if ($config['debug']['enabled']) {
echo '<h1>Error</h1>';
echo '<pre>' . $e->getMessage() . '</pre>';
echo '<pre>' . $e->getTraceAsString() . '</pre>';
} else {
echo '<h1>An error occurred</h1>';
echo '<p>Please check the configuration and try again.</p>';
}
}