!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/home/mnnews/public_html/login/phpmyadmin/libraries/sql-parser/src/Utils/   drwxr-xr-x
Free 1.9 GB of 27.03 GB (7.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Table.php (3.78 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
* Table utilities.
*
* @package    SqlParser
* @subpackage Utils
*/
namespace SqlParserUtils;

use
SqlParserStatementsCreateStatement;

/**
* Table utilities.
*
* @category   Statement
* @package    SqlParser
* @subpackage Utils
* @author     Dan Ungureanu <udan1107@gmail.com>
* @license    http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class Table
{

    
/**
     * Gets the foreign keys of the table.
     *
     * @param CreateStatement $statement The statement to be processed.
     *
     * @return array
     */
    
public static function getForeignKeys($statement)
    {
        if ((empty(
$statement->fields))
            || (!
is_array($statement->fields))
            || (!
$statement->options->has('TABLE'))
        ) {
            return array();
        }

        
$ret = array();

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

            
$columns = array();
            foreach (
$field->key->columns as $column) {
                
$columns[] = $column['name'];
            }

            
$tmp = array(
                
'constraint' => $field->name,
                
'index_list' => $columns,
            );

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

                if ((
$opt = $field->references->options->has('ON UPDATE'))) {
                    
$tmp['on_update'] = str_replace(' ', '_', $opt);
                }

                if ((
$opt = $field->references->options->has('ON DELETE'))) {
                    
$tmp['on_delete'] = str_replace(' ', '_', $opt);
                }

                
// if (($opt = $field->references->options->has('MATCH'))) {
                //     $tmp['match'] = str_replace(' ', '_', $opt);
                // }
            
}

            
$ret[] = $tmp;

        }

        return
$ret;
    }

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

        
$ret = array();

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

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

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

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

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

                if ((
$option = $field->options->has('AS'))) {
                    
$ret[$field->name]['generated'] = true;
                    
$ret[$field->name]['expr'] = $option;
                }
            }

        }

        return
$ret;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0072 ]--