first commit

This commit is contained in:
2026-10-29 13:34:31 +07:00
commit 45e4595c57
255 changed files with 35457 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
<?php
/*******************************************************************
Desc. : Proses Utama Runway
Created By : Siau Pheng ([email protected]).
Created Date : November 23rd, 2019.
Last Modified : September 3rd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
$ds = DIRECTORY_SEPARATOR;
$projectRoot = dirname(__DIR__, 2);
require $projectRoot . $ds . 'vendor' . $ds . 'autoload.php';
use App\Utils\Config;
use App\Utils\Env;
/* Loading configuration from .env */
Env::load($projectRoot . $ds . '.env');
$configPath = __DIR__ . $ds . 'config.php';
if (file_exists($configPath) === false) {
Flight::halt(500, 'Ada kendala dengan Konfigurasi Aplikasi, hubungi Developer.');
}
/* App Main Configuration */
$fileConfig = require $configPath;
/* Merge from .env and config */
$merged = Config::mergeEnv($fileConfig, $_ENV);
$config = new Config($merged);
// Setup timezone from config
$timezone = (string) $config->get('app.timezone', 'UTC');
if (!empty($timezone)) date_default_timezone_set($timezone);
// Character encoding
if (function_exists('mb_internal_encoding') === true) {
mb_internal_encoding('UTF-8');
}
// Default Locale Change as needed or feel free to remove.
if (function_exists('setlocale') === true) {
setlocale(LC_ALL, 'en_US.UTF-8');
}
// Error reporting level (E_ALL recommended for development)
error_reporting(E_ALL);
/* FlightPHP App Instance */
$app = Flight::app();
$app->set('app.project_root', $projectRoot);
$app->set('flight.base_url', $config->baseUrl());
$app->set('flight.case_sensitive', false);
$app->set('flight.log_errors', true);
$app->set('flight.handle_errors', $config->isDebug() === false);
$app->set('flight.views.path', __DIR__ . $ds . '..' . $ds . 'views');
$app->set('flight.views.extension', '.twig');
$app->set('flight.content_length', false);
$app->set('csp_nonce', bin2hex(random_bytes(16)));
//if (!defined('PROJECT_ROOT')) define('PROJECT_ROOT', $projectRoot);
//if (!defined('PROJECT_BASE')) define('PROJECT_BASE', $config->baseUrl());
if (!defined('RUNWAY_CMD')) define('RUNWAY_CMD', true);
/* Loading Services */
require(__DIR__ . $ds . 'services.php');
/* Loading App Configuration */
require(__DIR__ . $ds . 'app.php');