slovocast/app/src/Configuration/DatabaseConnectionSchema.php

22 lines
614 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')->default('mysql'),
'host' => Expect::string()->default('localhost'),
'port' => Expect::int()->min(1)->max(65535)->default(3306),
'database' => Expect::string()->required(),
'username' => Expect::string()->required(),
'password' => Expect::string()->required()
]);
}
}