uawdijnntqw1x1x1
IP : 3.16.137.217
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
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,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
.
/
kirov.axolotls.ru
/
bitrix
/
modules
/
perfmon
/
lib
/
sql
/
constraint.php
/
/
<?php namespace Bitrix\Perfmon\Sql; class Constraint extends BaseObject { /** * Creates constraint object from tokens. * <p> * If parameter $constraintName is not passed then current position should point to the name of the constraint. * * @param Tokenizer $tokenizer Tokens collection. * @param string $constraintName Optional name of the constraint. * * @return Constraint */ public static function create(Tokenizer $tokenizer, $constraintName = '') { if ($constraintName === false) { $constraintName = ''; } elseif (!$constraintName) { $constraintName = $tokenizer->getCurrentToken()->text; $tokenizer->nextToken(); $tokenizer->skipWhiteSpace(); } $constraint = new self($constraintName); $token = $tokenizer->getCurrentToken(); $level = $token->level; $constraintDefinition = ''; do { if ($token->level == $level && $token->text == ',') break; if ($token->level < $level && $token->text == ')') break; $constraintDefinition .= $token->text; $token = $tokenizer->nextToken(); } while (!$tokenizer->endOfInput()); $constraint->setBody($constraintDefinition); return $constraint; } /** * Return DDL for constraint creation. * * @param string $dbType Database type (MYSQL, ORACLE or MSSQL). * * @return array|string */ public function getCreateDdl($dbType = '') { switch ($dbType) { case "MYSQL": return "ALTER TABLE ".$this->parent->name." ADD CONSTRAINT ".$this->name." ".$this->body; case "MSSQL": return "ALTER TABLE ".$this->parent->name." ADD CONSTRAINT ".$this->name." ".$this->body; case "ORACLE": return "ALTER TABLE ".$this->parent->name." ADD CONSTRAINT ".$this->name." ".$this->body; default: return "// ".get_class($this).":getCreateDdl for database type [".$dbType."] not implemented"; } } /** * Return DDL for constraint destruction. * * @param string $dbType Database type (MYSQL, ORACLE or MSSQL). * * @return array|string */ public function getDropDdl($dbType = '') { switch ($dbType) { case "MYSQL": return "// ".get_class($this).":getDropDdl for database type [".$dbType."] not implemented"; case "MSSQL": return "ALTER TABLE ".$this->parent->name." DROP CONSTRAINT ".$this->name; case "ORACLE": return "ALTER TABLE ".$this->parent->name." DROP CONSTRAINT ".$this->name; default: return "// ".get_class($this).":getDropDdl for database type [".$dbType."] not implemented"; } } /** * Return DDL for constraint 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 array( $this->getDropDdl($dbType), $target->getCreateDdl($dbType), ); } }
/var/www/axolotl/data/www/./kirov.axolotls.ru/bitrix/modules/perfmon/lib/sql/constraint.php