░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
lon105.truehost.cloud
LOCATION:
/home/ilrtztmy/api.kimahtherealtor.com/api/src
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: bootstrap.php
<?php declare(strict_types=1); namespace KimahApi; function config(): array { static $config = null; if ($config === null) { $config = require dirname(__DIR__) . '/config/config.php'; } return $config; } function env(string $key, ?string $default = null): ?string { $value = config()[$key] ?? ($_ENV[$key] ?? getenv($key)); return ($value === false || $value === '' || $value === null) ? $default : (string) $value; } function jsonInput(): array { $raw = file_get_contents('php://input') ?: ''; if ($raw === '') return []; $data = json_decode($raw, true); if (!is_array($data)) { Response::json(['error' => 'Invalid JSON body'], 400); } return $data; } function requireFields(array $data, array $fields): void { foreach ($fields as $field) { if (!isset($data[$field]) || trim((string) $data[$field]) === '') { Response::json(['error' => "Missing required field: {$field}"], 422); } } } function cors(): void { $allowed = ['https://www.kimahtherealtor.com', 'https://kimahtherealtor.com']; $origin = $_SERVER['HTTP_ORIGIN'] ?? ''; if (in_array($origin, $allowed, true)) { header("Access-Control-Allow-Origin: {$origin}"); header('Access-Control-Allow-Credentials: true'); } header('Vary: Origin'); header('Access-Control-Allow-Headers: Content-Type, X-CSRF-Token, Authorization'); header('Access-Control-Allow-Methods: GET, POST, PATCH, DELETE, OPTIONS'); } function boot(): void { cors(); if (($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'OPTIONS') { http_response_code(204); exit; } if (session_status() === PHP_SESSION_NONE) { session_name(env('SESSION_NAME', 'kimah_admin')); session_set_cookie_params([ 'lifetime' => (int) env('SESSION_LIFETIME', '7200'), 'path' => '/', 'secure' => true, 'httponly' => true, 'samesite' => 'Lax', ]); session_start(); } }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 Auth.php
PHP
2.5 KB
2026-08-31 14:56
EDIT
📄 bootstrap.php
PHP
2.1 KB
2026-09-01 07:58
EDIT
📄 Database.php
PHP
1 KB
2026-08-31 22:07
EDIT
📄 Response.php
PHP
474 B
2026-08-31 14:56
EDIT