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