PMA\libraries\Util::isForeignKeyCheck PHP Method

isForeignKeyCheck() public static method

Is Foreign key check enabled?
public static isForeignKeyCheck ( ) : boolean
return boolean
    public static function isForeignKeyCheck()
    {
        if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'enable') {
            return true;
        } else {
            if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'disable') {
                return false;
            }
        }
        return $GLOBALS['dbi']->getVariable('FOREIGN_KEY_CHECKS') == 'ON';
    }

Usage Example

コード例 #1
0
ファイル: sql.php プロジェクト: poush/phpmyadmin
    PMA_getRelationalValues($db, $table);
    // script has exited at this point
}
// Just like above, find possible values for enum fields during grid edit.
if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true) {
    PMA_getEnumOrSetValues($db, $table, "enum");
    // script has exited at this point
}
// Find possible values for set fields during grid edit.
if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
    PMA_getEnumOrSetValues($db, $table, "set");
    // script has exited at this point
}
if (isset($_REQUEST['get_default_fk_check_value']) && $_REQUEST['get_default_fk_check_value'] == true) {
    $response = Response::getInstance();
    $response->addJSON('default_fk_check_value', Util::isForeignKeyCheck());
    exit;
}
/**
 * Check ajax request to set the column order and visibility
 */
if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
    PMA_setColumnOrderOrVisibility($table, $db);
    // script has exited at this point
}
// Default to browse if no query set and we have table
// (needed for browsing from DefaultTabTable)
$tableLength = mb_strlen($table);
$dbLength = mb_strlen($db);
if (empty($sql_query) && $tableLength && $dbLength) {
    $sql_query = PMA_getDefaultSqlQueryForBrowse($db, $table);
Util