ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:27.14 GB of 70.42 GB (38.54%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: 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,

/ usr/ share/ php/ adodb/ datadict/ - drwxr-xr-x

Directory:
Viewing file:     datadict-mysql.inc.php (4.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
  V5.10 10 Nov 2009   (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
  Whenever there is any discrepancy between the two licenses, 
  the BSD license will take precedence.
    
  Set tabs to 4 for best viewing.
 
*/

// security - hide paths
if (!defined('ADODB_DIR')) die();

class 
ADODB2_mysql extends ADODB_DataDict {
    var 
$databaseType 'mysql';
    var 
$alterCol ' MODIFY COLUMN';
    var 
$alterTableAddIndex true;
    var 
$dropTable 'DROP TABLE IF EXISTS %s'// requires mysql 3.22 or later
    
    
var $dropIndex 'DROP INDEX %s ON %s';
    var 
$renameColumn 'ALTER TABLE %s CHANGE COLUMN %s %s %s';    // needs column-definition!
    
    
function MetaType($t,$len=-1,$fieldobj=false)
    {
        if (
is_object($t)) {
            
$fieldobj $t;
            
$t $fieldobj->type;
            
$len $fieldobj->max_length;
        }
        
$is_serial is_object($fieldobj) && $fieldobj->primary_key && $fieldobj->auto_increment;
        
        
$len = -1// mysql max_length is not accurate
        
switch (strtoupper($t)) {
        case 
'STRING'
        case 
'CHAR':
        case 
'VARCHAR'
        case 
'TINYBLOB'
        case 
'TINYTEXT'
        case 
'ENUM'
        case 
'SET':
            if (
$len <= $this->blobSize) return 'C';
            
        case 
'TEXT':
        case 
'LONGTEXT'
        case 
'MEDIUMTEXT':
            return 
'X';
            
        
// php_mysql extension always returns 'blob' even if 'text'
        // so we have to check whether binary...
        
case 'IMAGE':
        case 
'LONGBLOB'
        case 
'BLOB':
        case 
'MEDIUMBLOB':
            return !empty(
$fieldobj->binary) ? 'B' 'X';
            
        case 
'YEAR':
        case 
'DATE': return 'D';
        
        case 
'TIME':
        case 
'DATETIME':
        case 
'TIMESTAMP': return 'T';
        
        case 
'FLOAT':
        case 
'DOUBLE':
            return 
'F';
            
        case 
'INT'
        case 
'INTEGER': return $is_serial 'R' 'I';
        case 
'TINYINT': return $is_serial 'R' 'I1';
        case 
'SMALLINT': return $is_serial 'R' 'I2';
        case 
'MEDIUMINT': return $is_serial 'R' 'I4';
        case 
'BIGINT':  return $is_serial 'R' 'I8';
        default: return 
'N';
        }
    }

    function 
ActualType($meta)
    {
        switch(
strtoupper($meta)) {
        case 
'C': return 'VARCHAR';
        case 
'XL':return 'LONGTEXT';
        case 
'X': return 'TEXT';
        
        case 
'C2': return 'VARCHAR';
        case 
'X2': return 'LONGTEXT';
        
        case 
'B': return 'LONGBLOB';
            
        case 
'D': return 'DATE';
        case 
'TS':
        case 
'T': return 'DATETIME';
        case 
'L': return 'TINYINT';
        
        case 
'R':
        case 
'I4':
        case 
'I': return 'INTEGER';
        case 
'I1': return 'TINYINT';
        case 
'I2': return 'SMALLINT';
        case 
'I8': return 'BIGINT';
        
        case 
'F': return 'DOUBLE';
        case 
'N': return 'NUMERIC';
        default:
            return 
$meta;
        }
    }
    
    
// return string must begin with space
    
function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
    {    
        
$suffix '';
        if (
$funsigned$suffix .= ' UNSIGNED';
        if (
$fnotnull$suffix .= ' NOT NULL';
        if (
strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
        if (
$fautoinc$suffix .= ' AUTO_INCREMENT';
        if (
$fconstraint$suffix .= ' '.$fconstraint;
        return 
$suffix;
    }
    
    
/*
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
        [table_options] [select_statement]
        create_definition:
        col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
        [PRIMARY KEY] [reference_definition]
        or PRIMARY KEY (index_col_name,...)
        or KEY [index_name] (index_col_name,...)
        or INDEX [index_name] (index_col_name,...)
        or UNIQUE [INDEX] [index_name] (index_col_name,...)
        or FULLTEXT [INDEX] [index_name] (index_col_name,...)
        or [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
        [reference_definition]
        or CHECK (expr)
    */
    
    /*
    CREATE [UNIQUE|FULLTEXT] INDEX index_name
        ON tbl_name (col_name[(length)],... )
    */
    
    
function _IndexSQL($idxname$tabname$flds$idxoptions)
    {
        
$sql = array();
        
        if ( isset(
$idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
            if (
$this->alterTableAddIndex$sql[] = "ALTER TABLE $tabname DROP INDEX $idxname";
            else 
$sql[] = sprintf($this->dropIndex$idxname$tabname);

            if ( isset(
$idxoptions['DROP']) )
                return 
$sql;
        }
        
        if ( empty (
$flds) ) {
            return 
$sql;
        }
        
        if (isset(
$idxoptions['FULLTEXT'])) {
            
$unique ' FULLTEXT';
        } elseif (isset(
$idxoptions['UNIQUE'])) {
            
$unique ' UNIQUE';
        } else {
            
$unique '';
        }
        
        if ( 
is_array($flds) ) $flds implode(', ',$flds);
        
        if (
$this->alterTableAddIndex$s "ALTER TABLE $tabname ADD $unique INDEX $idxname ";
        else 
$s 'CREATE' $unique ' INDEX ' $idxname ' ON ' $tabname;
        
        
$s .= ' (' $flds ')';
        
        if ( isset(
$idxoptions[$this->upperName]) )
            
$s .= $idxoptions[$this->upperName];
        
        
$sql[] = $s;
        
        return 
$sql;
    }
}
?>
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.4086 seconds