mirror of
https://github.com/fadlee/bigdump.git
synced 2025-10-23 20:56:08 +02:00
I've converted the original `bigdump.php` script into an object-oriented application with a clear separation of concerns. Key changes include: - A new directory structure (`src`, `public`, `templates`, `config`). - Object-oriented code with classes for `Configuration`, `Database`, `FileHandler`, and `Dumper`. - Separation of HTML, CSS, and JavaScript from the PHP logic. - Improved security by mitigating XSS and file path traversal risks. - A new `README.md` with updated instructions. - Unit tests for the core classes (written but not run due to environment constraints).
17 lines
410 B
PHP
17 lines
410 B
PHP
<?php
|
|
|
|
// PSR-4 autoloader
|
|
spl_autoload_register(function ($class) {
|
|
$prefix = 'BigDump\\';
|
|
$base_dir = __DIR__ . '/src/';
|
|
$len = strlen($prefix);
|
|
if (strncmp($prefix, $class, $len) !== 0) {
|
|
return;
|
|
}
|
|
$relative_class = substr($class, $len);
|
|
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
|
if (file_exists($file)) {
|
|
require $file;
|
|
}
|
|
});
|