charsets = $charsets ?? Charsets::getMySQLCharsets( $this->dbi, $cfg['Server']['DisableIS'] ); $this->charsetsDescriptions = $charsetsDescriptions ?? Charsets::getMySQLCharsetsDescriptions( $this->dbi, $cfg['Server']['DisableIS'] ); $this->collations = $collations ?? Charsets::getMySQLCollations( $this->dbi, $cfg['Server']['DisableIS'] ); $this->defaultCollations = $defaultCollations ?? Charsets::getMySQLCollationsDefault( $this->dbi, $cfg['Server']['DisableIS'] ); } /** * Index action * * @return string HTML */ public function indexAction(): string { include_once ROOT_PATH . 'libraries/server_common.inc.php'; $charsets = []; foreach ($this->charsets as $charset) { $charsetCollations = []; foreach ($this->collations[$charset] as $collation) { $charsetCollations[] = [ 'name' => $collation, 'description' => Charsets::getCollationDescr($collation), 'is_default' => $collation === $this->defaultCollations[$charset], ]; } $charsets[] = [ 'name' => $charset, 'description' => $this->charsetsDescriptions[$charset] ?? '', 'collations' => $charsetCollations, ]; } return $this->template->render('server/collations/index', [ 'charsets' => $charsets, ]); } }