Compare commits
2 Commits
13baf7660c
...
610ed871bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
610ed871bb | ||
|
|
8d697f6f4f |
@@ -66,10 +66,8 @@ class Application
|
||||
$conn["PASSWORD"] = isset($_ENV[$this->getKey("PASSWORD", $key)]) ? $_ENV[$this->getKey("PASSWORD", $key)] : null;
|
||||
$conn["DATABASE"] = isset($_ENV[$this->getKey("DATABASE", $key)]) ? $_ENV[$this->getKey("DATABASE", $key)] : null;
|
||||
$conn["PORT"] = isset($_ENV[$this->getKey("PORT", $key)]) ? $_ENV[$this->getKey("PORT", $key)] : null;
|
||||
if($conn["TYPE"] == "sqlite")
|
||||
{
|
||||
if(!is_file($conn["DATABASE"]))
|
||||
{
|
||||
if ($conn["TYPE"] == "sqlite") {
|
||||
if (!is_file($conn["DATABASE"])) {
|
||||
$conn["DATABASE"] = ROOT . DS . "databases" . DS . $conn["DATABASE"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ class Templating
|
||||
{
|
||||
$this->_views = ROOT . DS . "views";
|
||||
$this->_cache = ROOT . DS . "cache";
|
||||
$this->_blade = new BladeOne($this->_views, $this->_cache, BladeOne::MODE_AUTO);
|
||||
$mode = ($this->isDebug()) ? BladeOne::MODE_AUTO : BladeOne::MODE_FAST;
|
||||
$this->_blade = new BladeOne($this->_views, $this->_cache, $mode);
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
@@ -26,6 +27,15 @@ class Templating
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function isDebug(): bool
|
||||
{
|
||||
$ret = true;
|
||||
if (isset($_ENV["DEBUG"])) {
|
||||
$ret = ($_ENV["DEBUG"] == "true");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function render(string $template, array $params = []): string
|
||||
{
|
||||
return $this->_blade->run($template, $params);
|
||||
|
||||
Reference in New Issue
Block a user