-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbitrix-db.php
48 lines (37 loc) · 1.04 KB
/
bitrix-db.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
Получение параметров подключения к БД
*/
namespace Bitrixcli;
require(__DIR__ . '/lib/cli-cms.php');
class DbCli extends BitrixCli {
protected $limit = 13, $isShowLogFileName = false;
public static $cliParams = array(
'noVal' // без значения
=> array(),
'val' // со значением
=> array(),
'optionVal' // с необязательным значением
=> array(),
)
;
public function __construct($BitrixCMS) {
parent::__construct($BitrixCMS);
}
public function run() {
try {
$this->outputElements();
} catch (Exception $e) {
$this->error($e);
}
}
protected function outputElements() {
$config = $this->BitrixCMS->getConfig();
$connection =& $config['connections']['value']['default'];
if(!isset($connection) || !$connection) throw new Exception("Empty settings: connections");
$DataView = new DataView($connection);
$DataView->view('db');
}
}
$DbCli = new DbCli($BitrixCMS);
$DbCli->run();