-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.php
99 lines (90 loc) · 3.36 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
use Monster\App\Models\Env;
use Monster\App\Route;
/*
|--------------------------------------------------------------------------
| API-Monster Framework
|--------------------------------------------------------------------------
|
| API-Monster is a fast, safe, and easy-to-use PHP framework designed for
| building API applications. It provides a wide range of features and
| components to streamline the development process and enhance
| productivity.
|
| Features:
| - Fast: API-Monster is optimized for performance, allowing you to build
| high-performance API applications.
| - Safe: The framework prioritizes security and provides built-in mechanisms
| for handling common security concerns.
| - Easy: API-Monster follows a user-friendly approach, making it easy for
| developers to understand and work with the framework.
|
| Key Components:
| - Routing: API-Monster supports routing similar to Laravel, allowing you to
| define routes and map them to corresponding controller actions.
| - MySQL Class: The framework includes a MySQL class for easy interaction
| with MySQL databases.
| - HTTP Class: API-Monster provides an HTTP class for handling HTTP requests
| and responses, simplifying the communication with external APIs.
| - Cipher Class: The Cipher class offers encoding and decoding functionality,
| allowing you to securely handle sensitive data.
| - Controllers: API-Monster supports controllers, enabling you to organize
| your application's logic into modular and reusable components.
| - Object-Oriented Syntax: The framework utilizes object-oriented programming
| (OOP) syntax, promoting clean and maintainable code.
|
| Getting Started:
| To create a new API-Monster project, you can use Composer by running the
| following command:
| composer create-project darkphp/apimonster myapp
|
| GitHub Repository:
| For more information and to explore the framework's source code, you can
| visit the API-Monster GitHub repository at:
| https://github.com/ReactMVC/API-Monster
|
| Developer Information:
| API-Monster is developed by Hossein Pira. If you have any questions,
| suggestions, or feedback, you can reach out to Hossein via email at:
| Alternatively, you can contact Hossein on Telegram at @h3dev.
|
*/
/*
|--------------------------------------------------------------------------
| Application Bootstrap
|--------------------------------------------------------------------------
|
| This is the main entry point of the application. It handles the bootstrap
| process, including autoloading dependencies, loading routes, and running
| the application.
|
*/
// Autoload dependencies using Composer
require_once 'vendor/autoload.php';
// PHP error handling
$config = new Env('.env');
$debug = $config->get("APP_DEBUG");
if ($debug == "true") {
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
} else {
set_error_handler(function () {
http_response_code(500);
include_once("routes/errors/500.php");
exit();
});
set_exception_handler(function () {
http_response_code(500);
include_once("routes/errors/500.php");
exit();
});
}
// Load application helpers
require 'routes/helpers/base.php';
// Load application routes
require 'routes/web.php';
// Run the application
Route::run();