Add __toString() to Configuration class.

This commit is contained in:
Austen McDonald
2016-07-22 06:24:41 +00:00
parent 23c2b79094
commit 6efd89419b
+15
View File
@@ -119,4 +119,19 @@ class Configuration
{
return $this->logPath;
}
public function __toString(): string
{
$s = "";
$s .= "database:\n";
$s .= " dsn: " . $this->getDatabaseDSN() . "\n";
$s .= " name: " . $this->getDatabaseName() . "\n";
$s .= " user: " . $this->getDatabaseUser() . "\n";
$s .= " password: " . $this->getDatabasePassword() . "\n";
$s .= "logs:\n";
$s .= " path: " . $this->getLogPath() . "\n";
return $s;
}
}