config.inc.php

来自「phpMyAdmin图形界面化操作,我已经配置好了,只要把解要压缩后的文件放到站」· PHP 代码 · 共 2,813 行 · 第 1/5 页

PHP
2,813 行
字号
 */
$cfg['SaveDir'] = '';

/**
 * Directory where phpMyAdmin can save temporary files.
 * This is needed for MS Excel export, see documentation how to enable that.
 *
 * @global string $cfg['TempDir']
 */
$cfg['TempDir'] = '';


/**
 * Misc. settings
 */

/**
 * Is GD >= 2 available? Set to yes/no/auto. 'auto' does auto-detection,
 * which is the only safe way to determine GD version.
 *
 * @global string $cfg['GD2Available']
 */
$cfg['GD2Available'] = 'auto';

/**
 * List of trusted proxies for IP allow/deny
 *
 * @global array $cfg['TrustedProxies']
 */
$cfg['TrustedProxies'] = array();

/**
 * We normally check the permissions on the configuration file to ensure
 * it's not world writable. However, phpMyAdmin could be installed on
 * a NTFS filesystem mounted on a non-Windows server, in which case the
 * permissions seems wrong but in fact cannot be detected. In this case
 * a sysadmin would set the following to false.
 */
$cfg['CheckConfigurationPermissions'] = true;

/*******************************************************************************
 * SQL Parser Settings
 *
 * @global array $cfg['SQP']
 */
$cfg['SQP'] = array();

/**
 * Pretty-printing style to use on queries (html, text, none)
 *
 * @global string $cfg['SQP']['fmtType']
 */
$cfg['SQP']['fmtType'] = 'html';

/**
 * Amount to indent each level (floats are valid)
 *
 * @global integer $cfg['SQP']['fmtInd']
 */
$cfg['SQP']['fmtInd'] = '1';

/**
 * Units for indenting each level (CSS Types - {em, px, pt})
 *
 * @global string $cfg['SQP']['fmtIndUnit']
 */
$cfg['SQP']['fmtIndUnit'] = 'em';


/*******************************************************************************
 * If you wish to use the SQL Validator service, you should be aware of the
 * following:
 * All SQL statements are stored anonymously for statistical purposes.
 * Mimer SQL Validator, Copyright 2002 Upright Database Technology.
 * All rights reserved.
 *
 * @global array $cfg['SQLValidator']
 */
$cfg['SQLValidator'] = array();

/**
 * Make the SQL Validator available
 *
 * @global boolean $cfg['SQLValidator']['use']
 */
$cfg['SQLValidator']['use'] = false;

/**
 * If you have a custom username, specify it here (defaults to anonymous)
 *
 * @global string $cfg['SQLValidator']['username']
 */
$cfg['SQLValidator']['username'] = '';

/**
 * Password for username
 *
 * @global string $cfg['SQLValidator']['password']
 */
$cfg['SQLValidator']['password'] = '';


/*******************************************************************************
 * Developers ONLY!
 *
 * @global array $cfg['DBG']
 */
$cfg['DBG'] = array();

/**
 * Output executed queries and their execution times
 *
 * @global boolean $cfg['DBG']['enable']
 */
$cfg['DBG']['sql'] = false;

/**
 * Make the DBG stuff available
 * To use the following, please install the DBG extension from http://dd.cron.ru/dbg/
 *
 * @global boolean $cfg['DBG']['enable']
 */
$cfg['DBG']['php'] = false;

/**
 * Produce profiling results of PHP
 *
 * @global boolean $cfg['DBG']['profile']['enable']
 */
$cfg['DBG']['profile']['enable'] = false;

/**
 * Threshold of long running code to display
 * Anything below the threshold is not displayed
 *
 * @global float $cfg['DBG']['profile']['threshold']
 */
$cfg['DBG']['profile']['threshold'] = 0.5;


/*******************************************************************************
 * MySQL settings
 */

/**
 * Column types;
 * VARCHAR, TINYINT, TEXT and DATE are listed first, based on estimated popularity
 *
 * @global array $cfg['ColumnTypes']
 */
$cfg['ColumnTypes'] = array(
    // most used
    'INT',
    'VARCHAR',
    'TEXT',
    'DATE',

    // numeric
    'NUMERIC' => array(
        'TINYINT',
        'SMALLINT',
        'MEDIUMINT',
        'INT',
        'BIGINT',
        '-',
        'DECIMAL',
        'FLOAT',
        'DOUBLE',
        'REAL',
        '-',
        'BIT',
        'BOOL',
        'SERIAL',
    ),


    // Date/Time
    'DATE and TIME' => array(
        'DATE',
        'DATETIME',
        'TIMESTAMP',
        'TIME',
        'YEAR',
    ),

    // Text
    'STRING' => array(
        'CHAR',
        'VARCHAR',
        '-',
        'TINYTEXT',
        'TEXT',
        'MEDIUMTEXT',
        'LONGTEXT',
        '-',
        'BINARY',
        'VARBINARY',
        '-',
        'TINYBLOB',
        'MEDIUMBLOB',
        'BLOB',
        'LONGBLOB',
        '-',
        'ENUM',
        'SET',
    ),

    'SPATIAL' => array(
        'GEOMETRY',
        'POINT',
        'LINESTRING',
        'POLYGON',
        'MULTIPOINT',
        'MULTILINESTRING',
        'MULTIPOLYGON',
        'GEOMETRYCOLLECTION',
    ),
);

/**
 * Attributes
 *
 * @global array $cfg['AttributeTypes']
 */
$cfg['AttributeTypes'] = array(
   '',
   'BINARY',
   'UNSIGNED',
   'UNSIGNED ZEROFILL',
   'on update CURRENT_TIMESTAMP',
);


if ($cfg['ShowFunctionFields']) {
    /**
     * Available functions
     *
     * @global array $cfg['Functions']
     */
    $cfg['Functions'] = array(
        'ABS',
        'ACOS',
        'ASCII',
        'ASIN',
        'ATAN',
        'BIN',
        'BIT_COUNT',
        'BIT_LENGTH',
        'CEILING',
        'CHAR',
        'CHAR_LENGTH',
        'COMPRESS',
        'COS',
        'COT',
        'CRC32',
        'CURDATE',
        'CURRENT_USER',
        'CURTIME',
        'DATE',
        'DAYNAME',
        'DEGREES',
        'DES_DECRYPT',
        'DES_ENCRYPT',
        'ENCRYPT',
        'EXP',
        'FLOOR',
        'FROM_DAYS',
        'FROM_UNIXTIME',
        'HEX',
        'INET_ATON',
        'INET_NTOA',
        'LENGTH',
        'LN',
        'LOG',
        'LOG10',
        'LOG2',
        'LOWER',
        'MD5',
        'NOW',
        'OCT',
        'OLD_PASSWORD',
        'ORD',
        'PASSWORD',
        'RADIANS',
        'RAND',
        'REVERSE',
        'ROUND',
        'SEC_TO_TIME',
        'SHA1',
        'SOUNDEX',
        'SPACE',
        'SQRT',
        'STDDEV_POP',
        'STDDEV_SAMP',
        'TAN',
        'TIMESTAMP',
        'TIME_TO_SEC',
        'UNCOMPRESS',
        'UNHEX',
        'UNIX_TIMESTAMP',
        'UPPER',
        'USER',
        'UTC_DATE',
        'UTC_TIME',
        'UTC_TIMESTAMP',
        'UUID',
        'VAR_POP',
        'VAR_SAMP',
        'YEAR',
    );

    /**
     * Which column types will be mapped to which Group?
     *
     * @global array $cfg['RestrictColumnTypes']
     */
    $cfg['RestrictColumnTypes'] = array(
        'TINYINT'   => 'FUNC_NUMBER',
        'SMALLINT'  => 'FUNC_NUMBER',
        'MEDIUMINT' => 'FUNC_NUMBER',
        'INT'       => 'FUNC_NUMBER',
        'BIGINT'    => 'FUNC_NUMBER',
        'DECIMAL'   => 'FUNC_NUMBER',
        'FLOAT'     => 'FUNC_NUMBER',
        'DOUBLE'    => 'FUNC_NUMBER',
        'REAL'      => 'FUNC_NUMBER',
        'BIT'       => 'FUNC_NUMBER',
        'BOOL'      => 'FUNC_NUMBER',
        'SERIAL'    => 'FUNC_NUMBER',

        'DATE'      => 'FUNC_DATE',
        'DATETIME'  => 'FUNC_DATE',
        'TIMESTAMP' => 'FUNC_DATE',
        'TIME'      => 'FUNC_DATE',
        'YEAR'      => 'FUNC_DATE',

        'CHAR'          => 'FUNC_CHAR',
        'VARCHAR'       => 'FUNC_CHAR',
        'TINYTEXT'      => 'FUNC_CHAR',
        'TEXT'          => 'FUNC_CHAR',
        'MEDIUMTEXT'    => 'FUNC_CHAR',
        'LONGTEXT'      => 'FUNC_CHAR',
        'BINARY'        => 'FUNC_CHAR',
        'VARBINARY'     => 'FUNC_CHAR',
        'TINYBLOB'      => 'FUNC_CHAR',
        'MEDIUMBLOB'    => 'FUNC_CHAR',
        'BLOB'          => 'FUNC_CHAR',
        'LONGBLOB'      => 'FUNC_CHAR',
        'ENUM'          => '',
        'SET'           => '',

        'GEOMETRY'              => 'FUNC_SPATIAL',
        'POINT'                 => 'FUNC_SPATIAL',
        'LINESTRING'            => 'FUNC_SPATIAL',
        'POLYGON'               => 'FUNC_SPATIAL',
        'MULTIPOINT'            => 'FUNC_SPATIAL',
        'MULTILINESTRING'       => 'FUNC_SPATIAL',
        'MULTIPOLYGON'          => 'FUNC_SPATIAL',
        'GEOMETRYCOLLECTION'    => 'FUNC_SPATIAL',

    );

    /**
     * Map above defined groups to any function
     *
     * @global array $cfg['RestrictFunctions']
     */
    $cfg['RestrictFunctions'] = array(
        'FUNC_CHAR' => array(
            'BIN',
            'CHAR',
            'CURRENT_USER',
            'COMPRESS',
            'DAYNAME',
            'DES_DECRYPT',
            'DES_ENCRYPT',
            'ENCRYPT',
            'HEX',
            'INET_NTOA',
            'LOWER',
            'MD5',
            'OLD_PASSWORD',
            'PASSWORD',
            'REVERSE',
            'SHA1',
            'SOUNDEX',
            'SPACE',
            'UNCOMPRESS',
            'UNHEX',
            'UPPER',
            'USER',
            'UUID',
        ),

        'FUNC_DATE' => array(
            'CURDATE',
            'CURTIME',
            'DATE',
            'FROM_DAYS',
            'FROM_UNIXTIME',
            'NOW',
            'SEC_TO_TIME',
            'TIMESTAMP',
            'UTC_DATE',
            'UTC_TIME',
            'UTC_TIMESTAMP',
            'YEAR',
        ),

        'FUNC_NUMBER' => array(
            'ABS',
            'ACOS',
            'ASCII',
            'ASIN',
            'ATAN',
            'BIT_LENGTH',
            'BIT_COUNT',
            'CEILING',
            'CHAR_LENGTH',
            'COS',
            'COT',
            'CRC32',
            'DEGREES',
            'EXP',
            'FLOOR',
            'INET_ATON',
            'LENGTH',
            'LN',
            'LOG',
            'LOG2',
            'LOG10',
            'OCT',
            'ORD',
            'RADIANS',
            'RAND',
            'ROUND',
            'SQRT',
            'STDDEV_POP',
            'STDDEV_SAMP',
            'TAN',
            'TIME_TO_SEC',
            'UNIX_TIMESTAMP',
            'VAR_POP',
            'VAR_SAMP',
        ),

        'FUNC_SPATIAL' => array(
            'GeomFromText',
            'GeomFromWKB',

            'GeomCollFromText',
            'LineFromText',
            'MLineFromText',
            'PointFromText',
            'MPointFromText',
            'PolyFromText',
            'MPolyFromText',

            'GeomCollFromWKB',
            'LineFromWKB',
            'MLineFromWKB',
            'PointFromWKB',
            'MPointFromWKB',
            'PolyFromWKB',
            'MPolyFromWKB',
        ),
    );

    /**
     * Default functions for above defined groups
     *
     * @global array $cfg['DefaultFunctions']
     */
    $cfg['DefaultFunctions'] = array(
        'FUNC_CHAR' => '',
        'FUNC_DATE' => '',
        'FUNC_NUMBER' => '',
        'first_timestamp' => 'NOW',
        'pk_char36' => 'UUID',
    );


} // end if

/**
 * Search operators
 *
 * @global array $cfg['NumOperators']
 */
$cfg['NumOperators'] = array(
   '=',
   '>',
   '>=',
   '<',
   '<=',
   '!=',
   'LIKE',
   'NOT LIKE',
);

/**
 * Search operators
 *
 * @global array $cfg['TextOperators']
 */
$cfg['TextOperators'] = array(
   'LIKE',
   'LIKE %...%',
   'NOT LIKE',
   '=',
   '!=',
   'REGEXP',
   'NOT REGEXP',
   "= ''",
   "!= ''"
);

/**
 * Search operators
 *
 * @global array $cfg['EnumOperators']
 */
$cfg['EnumOperators'] = array(
   '=',
   '!=',
);

/**
 * Search operators
 *
 * @global array $cfg['SetOperators']
 */
$cfg['SetOperators'] = array(
   'IN',
   'NOT IN',
);

/**
 * Search operators
 *
 * @global array $cfg['NullOperators']
 */
$cfg['NullOperators'] = array(
   'IS NULL',
   'IS NOT NULL',
);

/**
 * Search operators
 *
 * @global array $cfg['UnaryOperators']
 */
$cfg['UnaryOperators'] = array(
   'IS NULL' => 1,
   'IS NOT NULL' => 1,
   "= ''" => 1,
   "!= ''" => 1
);

?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?