Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae19bba912 |
@@ -2,6 +2,5 @@
|
|||||||
<ruleset>
|
<ruleset>
|
||||||
<rule ref="PSR12"/>
|
<rule ref="PSR12"/>
|
||||||
<file>src/</file>
|
<file>src/</file>
|
||||||
<file>console</file>
|
|
||||||
<arg name="colors"/>
|
<arg name="colors"/>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
@@ -77,6 +77,12 @@ class Application
|
|||||||
$conn["DATABASE"] = $this->_root . DIRECTORY_SEPARATOR . "databases" . DIRECTORY_SEPARATOR . $conn["DATABASE"];
|
$conn["DATABASE"] = $this->_root . DIRECTORY_SEPARATOR . "databases" . DIRECTORY_SEPARATOR . $conn["DATABASE"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($conn["TYPE"] == "mysql") {
|
||||||
|
$charset = isset($_ENV[$this->getKey("CHARSET", $key)]) ? $_ENV[$this->getKey("CHARSET", $key)] : null;
|
||||||
|
if ($charset !== null) {
|
||||||
|
$conn["CHARSET"] = $charset;
|
||||||
|
}
|
||||||
|
}
|
||||||
$ret[$connection] = $conn;
|
$ret[$connection] = $conn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ class Container
|
|||||||
private static $instance;
|
private static $instance;
|
||||||
private array $container;
|
private array $container;
|
||||||
|
|
||||||
private function __construct() {
|
private function __construct()
|
||||||
|
{
|
||||||
$this->container = [];
|
$this->container = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getInstance() {
|
public static function getInstance()
|
||||||
|
{
|
||||||
if (self::$instance === null) {
|
if (self::$instance === null) {
|
||||||
self::$instance = new self();
|
self::$instance = new self();
|
||||||
}
|
}
|
||||||
@@ -19,11 +21,13 @@ class Container
|
|||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setValue($key, $value) {
|
public function setValue($key, $value)
|
||||||
|
{
|
||||||
$this->container[$key] = $value;
|
$this->container[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getValue($key) {
|
public function getValue($key)
|
||||||
|
{
|
||||||
return isset($this->container[$key]) ? $this->container[$key] : null;
|
return isset($this->container[$key]) ? $this->container[$key] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user