Files
crm.e5.pl/file_logger.php

25 lines
725 B
PHP
Raw Permalink Normal View History

2025-01-16 10:16:01 +00:00
<?php
register_shutdown_function(function() {
$system = '';
if (strpos($_SERVER['HTTP_HOST'], 'crm.e5.pl') !== false) {
$system = 'e5';
} elseif (strpos($_SERVER['HTTP_HOST'], 'crm.twinpol.com') !== false) {
$system = 'twinpol';
} else {
$systwm = 'other';
}
$files = get_included_files();
$conn = new mysqli('localhost', 'root', '5z#JaL', 'mz_logs');
if (!$conn->connect_error) {
$stmt = $conn->prepare("INSERT IGNORE INTO php_files_log (system, path) VALUES (?, ?)");
$stmt->bind_param("ss", $system, $file);
foreach ($files as $file) {
$stmt->execute();
}
$stmt->close();
$conn->close();
}
});
?>