1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-23 23:47:37 +00:00
Files
matomo/core/Db/Settings.php
Marc Neudert 3f541c2435 Add configuration for database connection collation (#22564)
* Add configuration for database connection collation

* Rename "connection_collation" config to "collation"

* Pass configured database collation to table creation statements

* Detect default collation to be used during database creation

* Save default database collation to config during installation

* Update database collection config if auto-detectable

* Add database collation to diagnostics

* Configure default collation for test environment

* Update expected screenshots

* Look at most recent archive table for update collation detection
2024-09-13 13:04:23 +02:00

52 خطوط
993 B
PHP

<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Db;
use Piwik\Db;
class Settings
{
public function getEngine()
{
return $this->getDbSetting('type');
}
public function getTablePrefix()
{
return $this->getDbSetting('tables_prefix');
}
public function getDbName()
{
return $this->getDbSetting('dbname');
}
public function getUsedCharset()
{
return strtolower($this->getDbSetting('charset'));
}
public function getUsedCollation()
{
return strtolower($this->getDbSetting('collation') ?? '');
}
public function getRowFormat()
{
return $this->getUsedCharset() === 'utf8mb4' ? 'ROW_FORMAT=DYNAMIC' : '';
}
private function getDbSetting($key)
{
$dbInfos = Db::getDatabaseConfig();
return $dbInfos[$key] ?? null;
}
}