schema для bd
This commit is contained in:
parent
0c9ae85fdc
commit
cbd50862ce
3 changed files with 9 additions and 2 deletions
|
|
@ -5,12 +5,15 @@
|
||||||
*/
|
*/
|
||||||
class Controller_Service
|
class Controller_Service
|
||||||
{
|
{
|
||||||
public $viewPath = array();
|
public $viewPath = [];
|
||||||
|
public $webPath = [];
|
||||||
public $registry; // Registry->getInstance
|
public $registry; // Registry->getInstance
|
||||||
public $template;
|
public $template;
|
||||||
public $templatePath;
|
public $templatePath;
|
||||||
public $COMPONENTS_WEB;
|
public $COMPONENTS_WEB;
|
||||||
|
|
||||||
|
public $db;
|
||||||
|
|
||||||
public function getTemplatePath($name)
|
public function getTemplatePath($name)
|
||||||
{
|
{
|
||||||
return Path::join($this->viewPath[0], 'templates', 'modern', $name);
|
return Path::join($this->viewPath[0], 'templates', 'modern', $name);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@ class Database extends PDO
|
||||||
if ($dsn['phptype'] == 'pgsql') {
|
if ($dsn['phptype'] == 'pgsql') {
|
||||||
$connection->query('SET client_encoding="UTF-8"');
|
$connection->query('SET client_encoding="UTF-8"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($dsn['schema'])) {
|
||||||
|
$connection->query('SET search_path TO ' . $dsn['schema']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($dsn['phptype'] == 'sqlite') {
|
if ($dsn['phptype'] == 'sqlite') {
|
||||||
/*.Database.*/$connection = new static("{$dsn['phptype']}:{$dsn['database']}");
|
/*.Database.*/$connection = new static("{$dsn['phptype']}:{$dsn['database']}");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue