From cbd50862ce920c74a6093561de0a802e49a3514b Mon Sep 17 00:00:00 2001 From: "CORP\\phedor" Date: Fri, 8 Jun 2018 15:20:43 +0300 Subject: [PATCH] =?UTF-8?q?schema=20=D0=B4=D0=BB=D1=8F=20bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Component.php | 2 +- src/Controller/Service.php | 5 ++++- src/Database.php | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Controller/Component.php b/src/Controller/Component.php index efc3cdf..e5a4bc2 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -273,7 +273,7 @@ class Controller_Component $instance->componentsConfig[] = $editor; } else { global $componentsConfig; - $componentsConfig[] = $editor; + $componentsConfig[] = $editor; } } diff --git a/src/Controller/Service.php b/src/Controller/Service.php index 46f96aa..5bc439f 100644 --- a/src/Controller/Service.php +++ b/src/Controller/Service.php @@ -5,11 +5,14 @@ */ class Controller_Service { - public $viewPath = array(); + public $viewPath = []; + public $webPath = []; public $registry; // Registry->getInstance public $template; public $templatePath; public $COMPONENTS_WEB; + + public $db; public function getTemplatePath($name) { diff --git a/src/Database.php b/src/Database.php index 415619d..9544526 100644 --- a/src/Database.php +++ b/src/Database.php @@ -35,6 +35,10 @@ class Database extends PDO if ($dsn['phptype'] == 'pgsql') { $connection->query('SET client_encoding="UTF-8"'); } + + if (isset($dsn['schema'])) { + $connection->query('SET search_path TO ' . $dsn['schema']); + } } if ($dsn['phptype'] == 'sqlite') { /*.Database.*/$connection = new static("{$dsn['phptype']}:{$dsn['database']}");