-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.php
More file actions
43 lines (35 loc) · 919 Bytes
/
Copy pathconfig.php
File metadata and controls
43 lines (35 loc) · 919 Bytes
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
<?php
declare(strict_types=1);
// Require PHP 8.3+
if (PHP_VERSION_ID < 80300) {
die('PHP 8.3 or higher is required');
}
// Database Configuration
define('DB_FILE', __DIR__ . '/data.json');
// CORS Headers
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
header('Access-Control-Allow-Headers: Content-Type');
// Error Handling
error_reporting(E_ALL);
ini_set('display_errors', '0');
// Session
session_start();
// Enums for Transaction Types
enum TransactionType: string {
case DEPOSIT = 'deposit';
case WITHDRAWAL = 'withdrawal';
case TRANSFER = 'transfer';
case RECEIVED = 'received';
}
enum RequestStatus: string {
case PENDING = 'pending';
case APPROVED = 'approved';
case REJECTED = 'rejected';
}
enum UserRole: string {
case USER = 'user';
case ADMIN = 'admin';
}
?>