%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.22.241.228 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/perfmon/classes/general/ |
Upload File : |
<?php class CPerfomanceSchema { var $data_relations = null; function Init() { if (!isset($this->data_relations)) { $this->data_relations = array(); foreach (GetModuleEvents("perfmon", "OnGetTableSchema", true) as $arEvent) { $arModuleSchema = ExecuteModuleEventEx($arEvent); if (is_array($arModuleSchema)) { foreach ($arModuleSchema as $module_id => $arModuleTables) { if (!array_key_exists($module_id, $this->data_relations)) $this->data_relations[$module_id] = array(); foreach ($arModuleTables as $parent_table_name => $arParentColumns) { if (!array_key_exists($parent_table_name, $this->data_relations[$module_id])) $this->data_relations[$module_id][$parent_table_name] = array(); foreach ($arParentColumns as $parent_column => $arChildren) { if (!array_key_exists($parent_column, $this->data_relations[$module_id][$parent_table_name])) $this->data_relations[$module_id][$parent_table_name][$parent_column] = array(); foreach ($arChildren as $child_table_name => $child_column) { $this->data_relations[$module_id][$parent_table_name][$parent_column][$child_table_name] = $child_column; } } } } } } } } function GetChildren($table_name) { $this->Init(); $result = array(); foreach ($this->data_relations as $module_id => $arModuleTables) { if (array_key_exists($table_name, $arModuleTables)) $key = $table_name; elseif (array_key_exists(mb_strtolower($table_name), $arModuleTables)) $key = mb_strtolower($table_name); elseif (array_key_exists(mb_strtoupper($table_name), $arModuleTables)) $key = mb_strtoupper($table_name); else $key = ''; if ($key) { foreach ($arModuleTables[$key] as $parent_column => $arChildren) { foreach ($arChildren as $child_table_name => $child_column) $result[] = array( "PARENT_COLUMN" => $parent_column, "CHILD_TABLE" => trim($child_table_name, "^"), "CHILD_COLUMN" => $child_column, ); } } } uasort($result, array("CPerfomanceSchema", "_sort")); return $result; } function GetParents($table_name) { $this->Init(); $result = array(); foreach ($this->data_relations as $module_id => $arModuleTables) { foreach ($arModuleTables as $parent_table_name => $arParentColumns) { foreach ($arParentColumns as $parent_column => $arChildren) { foreach ($arChildren as $child_table_name => $child_column) { $child_table_name = trim($child_table_name, "^"); if ( $child_table_name === $table_name || $child_table_name === mb_strtolower($table_name) || $child_table_name === mb_strtoupper($table_name) ) $result[$child_column] = array( "PARENT_TABLE" => $parent_table_name, "PARENT_COLUMN" => $parent_column, ); } } } } uasort($result, array("CPerfomanceSchema", "_sort")); return $result; } private function _sort($a, $b) { if (isset($a["CHILD_TABLE"])) return strcmp($a["CHILD_TABLE"], $b["CHILD_TABLE"]); else return strcmp($a["PARENT_TABLE"], $b["PARENT_TABLE"]); } }