slovocast/app/src/Configuration/DatabaseConnectionSchema.php

22 lines
614 B
PHP
Raw Normal View History

<?php
namespace Slovocast\Configuration;
use Nette\Schema\Expect;
use Nette\Schema\Schema;
class DatabaseConnectionSchema
{
public static function getSchema(): Schema
{
return Expect::structure([
'driver' => Expect::anyOf('mysql', 'sqlite')->default('mysql'),
'host' => Expect::string()->default('localhost'),
'port' => Expect::int()->min(1)->max(65535)->default(3306),
'database' => Expect::string()->required(),
'username' => Expect::string()->required(),
2024-11-06 03:38:26 +00:00
'password' => Expect::string()->required()
]);
}
}