22 lines
593 B
PHP
22 lines
593 B
PHP
|
<?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')->required(),
|
||
|
'host' => Expect::string()->default('localhost'),
|
||
|
'post' => Expect::int()->min(1)->max(65535),
|
||
|
'database' => Expect::string()->required(),
|
||
|
'username' => Expect::string()->required(),
|
||
|
'password' => Expect::string()->nullable()
|
||
|
]);
|
||
|
}
|
||
|
}
|