1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
basedatabase.php
См. документацию.
1<?php
2
3namespace Bitrix\Perfmon;
4
6{
7 protected $connection = null;
8 protected $schema = null;
9
10 public function __construct($connection)
11 {
12 $this->connection = $connection;
13 $this->schema = new \Bitrix\Perfmon\Sql\Schema;
14 }
15
23 public static function createFromConnection($connection)
24 {
25 if (is_a($connection, '\Bitrix\Main\DB\MysqliConnection'))
26 {
27 return new MysqliDatabase($connection);
28 }
29 elseif (is_a($connection, '\Bitrix\Main\DB\PgsqlConnection'))
30 {
31 return new PgsqlDatabase($connection);
32 }
33 else
34 {
35 throw new \Bitrix\Main\DB\ConnectionException('Unsupported connection type.');
36 }
37 }
38
46 public function getTables($full = true)
47 {
48 $result = new \CDBResult();
49 $result->InitFromArray([]);
50
51 return $result;
52 }
53
61 protected function fillTableIndexes($tableName)
62 {
63 $table = $this->schema->tables->search($tableName);
64 if (!$table)
65 {
66 $table = new \Bitrix\Perfmon\Sql\Table($tableName);
67 $this->schema->tables->add($table);
68 }
69
70 return $table;
71 }
72
80 public function getIndexes($tableName)
81 {
82 $result = [];
83
84 $table = $this->fillTableIndexes($tableName);
86 foreach ($table->indexes->getList() as $index)
87 {
88 $result[$index->name] = $index->columns;
89 }
90
91 return $result;
92 }
93
101 public function getUniqueIndexes($tableName)
102 {
103 $result = [];
104
105 $table = $this->fillTableIndexes($tableName);
107 foreach ($table->indexes->getList() as $index)
108 {
109 if ($index->unique)
110 {
111 $result[$index->name] = $index->columns;
112 }
113 }
114
115 return $result;
116 }
117
125 public function getFullTextIndexes($tableName)
126 {
127 $result = [];
128
129 $table = $this->fillTableIndexes($tableName);
131 foreach ($table->indexes->getList() as $index)
132 {
133 if ($index->fulltext)
134 {
135 $result[$index->name] = $index->columns;
136 }
137 }
138
139 return $result;
140 }
141
149 public function getTableFields($tableName = false)
150 {
151 return [];
152 }
153}
__construct($connection)
Определения basedatabase.php:10
static createFromConnection($connection)
Определения basedatabase.php:23
fillTableIndexes($tableName)
Определения basedatabase.php:61
getTableFields($tableName=false)
Определения basedatabase.php:149
getTables($full=true)
Определения basedatabase.php:46
$result
Определения get_property_values.php:14
$table
Определения mysql_to_pgsql.php:36
Определения basedatabase.php:3
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393