Log mislukte logins als LOGIN_FAILED (fail2ban/rapportage), logger-threshold naar 5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Minimal bootstrap for the unit tests: loads the composer autoloader and the
|
||||
* CodeIgniter 4 core functions (log_message, config, ...) without booting the
|
||||
* application (no database, session or routing). WRITEPATH points to a temp
|
||||
* dir so tests never touch writable/logs.
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
define('ENVIRONMENT', 'testing');
|
||||
define('CI_DEBUG', true);
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$tmp = sys_get_temp_dir() . '/dbois-phpunit-' . getmypid() . '/';
|
||||
mkdir($tmp . 'logs', 0777, true);
|
||||
register_shutdown_function(static function () use ($tmp) {
|
||||
array_map('unlink', glob($tmp . 'logs/*') ?: []);
|
||||
@rmdir($tmp . 'logs');
|
||||
@rmdir($tmp);
|
||||
});
|
||||
|
||||
define('ROOTPATH', $root . '/');
|
||||
define('APPPATH', $root . '/app/');
|
||||
define('WRITEPATH', $tmp);
|
||||
define('SYSTEMPATH', $root . '/vendor/codeigniter4/framework/system/');
|
||||
define('FCPATH', $root . '/public/');
|
||||
|
||||
require $root . '/vendor/autoload.php';
|
||||
require SYSTEMPATH . 'Common.php';
|
||||
Reference in New Issue
Block a user