Minor fixes

- Corrected CodeIgniter Framework version to specific version
- Added checks in Database seeder

Signed-off-by: objec <objecttothis@gmail.com>
This commit is contained in:
objec
2026-03-30 17:06:55 +04:00
parent 28884a035c
commit d8a46bca03
2 changed files with 10 additions and 1 deletions

View File

@@ -9,9 +9,18 @@ class TestDatabaseBootstrapSeeder extends Seeder
{
public function run(): void
{
if (ENVIRONMENT !== 'testing') {
throw new \RuntimeException('TestDatabaseBootstrapSeeder can only run in the testing environment.');
}
$config = config('Database');
$group = $config->tests;
$dbName = $group['database'];
if ($dbName === '' || !str_contains(strtolower($dbName), 'test')) {
throw new \RuntimeException("Refusing to reset non-test database: {$dbName}");
}
$serverConn = Database::connect([
'hostname' => $group['hostname'],
'username' => $group['username'],

View File

@@ -33,7 +33,7 @@
"require": {
"ext-intl": "*",
"php": "^8.1",
"codeigniter4/framework": "^4.6.3",
"codeigniter4/framework": "4.6.3",
"dompdf/dompdf": "^2.0.3",
"ezyang/htmlpurifier": "^4.17",
"laminas/laminas-escaper": "2.17.0",