Skip to content

Commit

Permalink
Merge pull request concretecms#11974 from aembler/fix-info-command
Browse files Browse the repository at this point in the history
Fix broken c5:info command
  • Loading branch information
aembler authored Mar 6, 2024
2 parents 984b7eb + 6844712 commit e993ce0
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions concrete/src/System/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ public function __construct()
$this->dbVersion = $config->get('concrete.version_db');
$this->versionInstalled = $config->get('concrete.version_installed');

$resolver = $this->app->make(Resolver::class);
$db = $this->app->make('database')->connection();
[$this->dbCharset, $this->dbCollation] = $resolver->resolveCharacterSetAndCollation($db);

$versions = ['Core Version - '. $this->codeVersion];
if ($this->installed) {
$versions[] = 'Version Installed - ' . $this->versionInstalled;
Expand Down Expand Up @@ -466,12 +462,23 @@ public function getDbVersion()
{
return $this->dbVersion;
}

/**
* @return string
*/
public function getDbCharset()
{
if ($this->dbCharset === null) {
$this->dbCharset = '';
if ($this->installed) {
try {
$resolver = $this->app->make(Resolver::class);
$db = $this->app->make('database')->connection();
[$this->dbCharset, $dbCollationIgnored] = $resolver->resolveCharacterSetAndCollation($db);
} catch (\Exception $x) {
}
}
}
return $this->dbCharset;
}

Expand All @@ -480,6 +487,17 @@ public function getDbCharset()
*/
public function getDbCollation()
{
if ($this->dbCollation === null) {
$this->dbCollation = '';
if ($this->installed) {
try {
$resolver = $this->app->make(Resolver::class);
$db = $this->app->make('database')->connection();
[$dbCharsetIgnored, $this->dbCollation] = $resolver->resolveCharacterSetAndCollation($db);
} catch (\Exception $x) {
}
}
}
return $this->dbCollation;
}

Expand Down

0 comments on commit e993ce0

Please sign in to comment.