mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
889 B
PHP
35 lines
889 B
PHP
<?php
|
|
|
|
use App\Services\ConfigCacheService;
|
|
use App\Util\Database\DatabaseDriver;
|
|
|
|
if (! function_exists('config_cache')) {
|
|
function config_cache($key)
|
|
{
|
|
return ConfigCacheService::get($key);
|
|
}
|
|
}
|
|
|
|
if (! function_exists('db_is_mysql_maria')) {
|
|
/**
|
|
* True when the active (or given) connection uses MySQL or MariaDB.
|
|
*
|
|
* Use instead of config('database.default') === 'mysql', which misses
|
|
* MariaDB (Laravel exposes it as a distinct 'mariadb' driver).
|
|
*/
|
|
function db_is_mysql_maria(?string $connection = null): bool
|
|
{
|
|
return DatabaseDriver::isMysqlMaria($connection);
|
|
}
|
|
}
|
|
|
|
if (! function_exists('db_is_pgsql')) {
|
|
/**
|
|
* True when the active (or given) connection uses PostgreSQL.
|
|
*/
|
|
function db_is_pgsql(?string $connection = null): bool
|
|
{
|
|
return DatabaseDriver::isPgsql($connection);
|
|
}
|
|
}
|