refactor: extract configuration into config.php
- New config.php.example template (tracked) - config.php git-ignored - index.php loads config.php if present, falls back to defaults
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
# PHP file browser
|
# PHP file browser
|
||||||
# (index.php and AGENTS.md are the project files)
|
config.php
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* phpfilebrowser — Configuration
|
||||||
|
*
|
||||||
|
* Copy this file to config.php and adjust the values.
|
||||||
|
* config.php is git-ignored; config.php.example is tracked.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ── Directory to browse ─────────────────────────────────────────
|
||||||
|
// Absolute path to the root directory the browser should serve
|
||||||
|
define('ENTRY_POINT', '/var/www');
|
||||||
@@ -5,7 +5,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// ── Configuration ──────────────────────────────────────────────────────────
|
// ── Configuration ──────────────────────────────────────────────────────────
|
||||||
define('ENTRY_POINT', '/tmp'); // Change to desired root directory
|
// Load config.php if present, otherwise use defaults
|
||||||
|
if (file_exists(__DIR__ . '/config.php')) {
|
||||||
|
require __DIR__ . '/config.php';
|
||||||
|
}
|
||||||
|
if (!defined('ENTRY_POINT')) {
|
||||||
|
define('ENTRY_POINT', '/tmp');
|
||||||
|
}
|
||||||
|
|
||||||
// ── Helpers ────────────────────────────────────────────────────────────────
|
// ── Helpers ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user