PHP 클래스 PMA\libraries\Util

파일 보기 프로젝트 열기: phpmyadmin/phpmyadmin 1 사용 예제들

공개 메소드들

메소드 설명
addMicroseconds ( string $value ) : string Add fractional seconds to time, datetime and timestamp strings.
asWKT ( string $data, boolean $includeSRID = false ) : string Converts GIS data to Well Known Text format
backquote ( mixed $a_name, boolean $do_it = true ) : mixed Adds backquotes on both sides of a database, table or field name.
backquoteCompat ( mixed $a_name, string $compatibility = 'MSSQL', boolean $do_it = true ) : mixed Adds backquotes on both sides of a database, table or field name.
buildActionTitles ( ) : array Build titles and icons for action links
cacheExists ( string $var ) : boolean Verifies if something is cached in the session
cacheGet ( string $var, Closure $callback = null ) : mixed Gets cached information from the session
cacheSet ( string $var, mixed $val = null ) : mixed Caches information in the session
cacheUnset ( string $var ) : void Removes cached information from the session
checkParameters ( string[] $params, boolean $request = true ) : void Function added to avoid path disclosures.
clearUserCache ( ) : void Clears cache content which needs to be refreshed on user change.
configureCurl ( resource $curl_handle ) : resource Updates an existing curl as necessary
containsNonPrintableAscii ( string $value ) : integer Verifies whether the value contains a non-printable character
convertBitDefaultValue ( string $bit_default_value ) : string Converts a BIT type default value for example, b'010' becomes 010
createGISData ( string $gis_string ) : string Generates GIS data based on the string passed.
currentUserHasPrivilege ( string $priv, mixed $db = null, mixed $tbl = null ) : boolean Checks if the current user has a specific privilege and returns true if the user indeed has that privilege or false if (s)he doesn't. This function must only be used for features that are available since MySQL 5, because it relies on the INFORMATION_SCHEMA database to be present.
duplicateFirstNewline ( string $string ) : string If the string starts with a \r\n pair (0x0d0a) add an extra \n
escapeMysqlWildcards ( string $name ) : string Add slashes before "_" and "%" characters for using them in MySQL database, table and field names.
expandUserString ( string $string, array | string $escape = null, array $updates = [] ) : string Formats user string, expanding @VARIABLES@, accepting strftime format string.
extractColumnSpec ( string $columnspec ) : array Extracts the various parts from a column spec
extractValueFromFormattedSize ( string $formatted_size ) : integer Returns the number of bytes when a formatted size is given
formatByteDown ( double | integer $value, integer $limes = 6, integer $comma ) : array Formats $value to byte view
formatNumber ( double $value, integer $digits_left = 3, integer $digits_right, boolean $only_down = false, boolean $noTrailingZero = true ) : string Formats $value to the given length and appends SI prefixes with a $length of 0 no truncation occurs, number is only formatted to the current locale
formatSql ( string $sqlQuery, boolean $truncate = false ) : string format sql strings
generateHiddenMaxFileSize ( integer $max_size ) : string Generates a hidden field which should indicate to the browser the maximum size for upload
getBrowseUploadFileBlock ( string $max_upload_size ) : String Prepare the form used to browse anywhere on the local server for a file to import
getButton ( ) : String Prepare HTML code for display button.
getButtonOrImage ( string $button_name, string $button_class, string $text, string $image, string $value = '' ) : string Generate a button or image tag
getCharsetQueryPart ( string $collation, $override = false ) : string Generate the charset query part
getClassForType ( string $type ) : string Returns the proper class clause according to the column type
getCollateForIS ( ) : string Provide COLLATE clause, if required, to perform case sensitive comparisons for queries on information_schema.
getCompressionMimeType ( resource $file ) : string Reads the file, detects the compression MIME type, closes the file and returns the MIME type
getDbInfo ( string $db, string $sub_part ) : array Gets the list of tables in the current db and information about these tables if possible
getDbLink ( string $database = null ) : string returns html code for db link to default db page
getDefaultFunctionForField ( array $field, boolean $insert_mode ) : string Returns default function for a particular column.
getDivForSliderEffect ( string $id = '', string $message = '' ) : string Generates a slider effect (jQjuery) Takes care of generating the initial
and the link controlling the slider; you have to generate the
yourself after the sliding section.
getDocuLink ( string $page, string $anchor = '' ) : string Returns link to documentation.
getDropdown ( string $select_name, array $choices, string $active_choice, string $id, string $class = '', string $placeholder = null ) : string Generates and returns an HTML dropdown
getExternalBug ( string $functionality, string $component, string $minimum_version, string $bugref ) : String Prepare a lightbulb hint explaining a known external bug that affects a functionality
getFKCheckbox ( ) : string Get HTML for Foreign key check checkbox
getFirstOccurringRegularExpression ( array $regex_array, String $query ) : String Get regular expression which occur first inside the given sql query.
getFormattedMaximumUploadSize ( integer $max_upload_size ) : string Returns the formatted maximum size for an upload
getFunctionsForField ( array $field, boolean $insert_mode, $foreignData ) : string Creates a dropdown box with MySQL functions for a particular column.
getGISDatatypes ( boolean $upper_case = false ) : string[] Return GIS data types
getGISFunctions ( string $geom_type = null, boolean $binary = true, boolean $display = false ) : array Returns the names and details of the functions that can be applied on geometry data types.
getHtmlTab ( array $tab, array $url_params = [] ) : string returns a tab for tabbed navigation.
getHtmlTabs ( array $tabs, array $url_params, string $menu_id, boolean $resizable = false ) : string returns html-code for a tab navigation
getIcon ( string $icon, string $alternate = '', boolean $force_text = false, boolean $menu_icon = false, string $control_param = 'ActionLinksMode' ) : string Returns an HTML IMG tag for a particular icon from a theme, which may be an actual file or an icon from a sprite.
getImage ( string $image, string $alternate = '', array $attributes = [] ) : string Returns an HTML IMG tag for a particular image from a theme, which may be an actual file or an icon from a sprite
getListNavigator ( integer $count, integer $pos, array $_url_params, string $script, string $frame, integer $max_count, string $name = 'pos', string[] $classes = [] ) : string Prepare navigation for a list
getMenuTabList ( string $level = null ) : array Return the list of tabs for the menu with corresponding names
getMessage ( Message | string $message, string $sql_query = null, string $type = 'notice' ) : string Prepare the message and the query usually the message is the result of the query executed
getMySQLDocuURL ( string $link, string $anchor = '' ) : string Get a URL link to the official MySQL documentation
getNavigationLink ( string $link, boolean $showText, string $text, boolean $showIcon, string $icon, string $linkId = '', boolean $disableAjax = false, string $linkTarget = '', array $classes = [] ) : string Renders a single link for the top of the navigation panel
getRadioFields ( string $html_field_name, array $choices, string $checked_choice = '', boolean $line_break = true, boolean $escape_label = true, string $class = '', string $id_prefix = '' ) : string Generates a set of radio HTML fields
getScriptNameForOption ( string $target, string $location ) : string Get the script name corresponding to a plain English config word in order to append in links on navigation and main panel
getSelectUploadFileBlock ( ImportPlugin[] $import_list, string $uploaddir ) : String Prepare the form used to select a file to import from the server upload directory
getServerType ( ) : string Returns server type for current connection
getStartAndNumberOfRowsPanel ( string $sql_query ) : string Function to get html for the start row and number of rows panel
getSupportedDatatypes ( boolean $html = false, string $selected = '' ) : mixed This function processes the datatypes supported by the DB, as specified in Types->getColumns() and either returns an array (useful for quickly checking if a datatype is supported) or an HTML snippet that creates a drop-down list.
getTableList ( string $db, string $tables = null, integer $limit_offset, integer | boolean $limit_count = false ) : array returns array with tables of given db with extended information and grouped
getTablesWhenOpen ( string $db, object $db_info_result ) : array Gets the list of tables in the current db, taking into account that they might be "in use"
getTitleForTarget ( string $target ) : string Get the action word corresponding to a script name in order to display it as a title in navigation panel
getUniqueCondition ( resource $handle, integer $fields_cnt, array $fields_meta, array $row, boolean $force_unique = false, string | boolean $restrict_to_table = false, array $analyzed_sql_results = null ) : array Function to generate unique condition for specified row.
handleContext ( array $context ) : array Returns information with regards to handling the http request
handleDisableFKCheckCleanup ( boolean $default_fk_check_value ) : void Cleanup changes done for foreign key check
handleDisableFKCheckInit ( ) : boolean Handle foreign key check request
httpRequest ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed Creates HTTP request
httpRequestCurl ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed Creates HTTP request using curl
httpRequestFopen ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed Creates HTTP request using file_get_contents
httpRequestReturn ( mixed $response, interger $http_status, boolean $return_only_status ) : mixed Creates HTTP request using curl
isForeignKeyCheck ( ) : boolean Is Foreign key check enabled?
isForeignKeySupported ( string $engine ) : boolean Verifies if this table's engine supports foreign keys
isVirtualColumnsSupported ( ) : boolean Returns whether the database server supports virtual columns
linkOrButton ( string $url, string $message, mixed $tag_params = [], boolean $new_form = true, boolean $strip_img = false, string $target = '', boolean $force_button = false ) : string Displays a link, or a button if the link's URL is too large, to accommodate some browsers' limitations
listPHPExtensions ( ) : array Returs list of used PHP extensions.
localisedDate ( integer $timestamp, string $format = '' ) : string Writes localised date
mysqlDie ( string | boolean $server_msg = '', string $sql_query = '', boolean $is_modify_link = true, string $back_url = '', boolean $exit = true ) : string Displays a MySQL error message in the main panel when $exit is true.
pageselector ( string $name, integer $rows, integer $pageNow = 1, integer $nbTotalPage = 1, integer $showAll = 200, integer $sliceStart = 5, integer $sliceEnd = 5, integer $percent = 20, integer $range = 10, string $prompt = '' ) : string Generate a pagination selector for browsing resultsets
parseEnumSetValues ( string $definition, boolean $escapeHtml = true ) : array Parses ENUM/SET values
printableBitValue ( integer $value, integer $length ) : string Converts a bit value to printable format; in MySQL a BIT field can be from 1 to 64 bits so we need this function because in PHP, decbin() supports only 32 bits on 32-bit servers
processIndexData ( array $indexes ) : array Process the index data.
profilingSupported ( ) : boolean Verifies if current MySQL server supports profiling
requestString ( mixed $value ) : string Converts given (request) paramter to string
showDocLink ( string $link, string $target = 'documentation', boolean $bbcode = false ) : string Displays a link to the documentation as an icon
showDocu ( string $page, string $anchor = '', boolean $bbcode = false ) : string Displays a link to the phpMyAdmin documentation
showHint ( string $message ) : string Returns HTML code for a tooltip
showIcons ( string $value ) : boolean Checks whether configuration value tells to show icons.
showMySQLDocu ( string $link, boolean $big_icon = false, string $anchor = '', boolean $just_open = false ) : string Displays a link to the official MySQL documentation
showPHPDocu ( string $target ) : string Displays a link to the PHP documentation
showText ( string $value ) : boolean Checks whether configuration value tells to show text.
splitURLQuery ( string $url ) : array Splits a URL string by parameter
timespanFormat ( integer $seconds ) : string Returns a given timespan value in a readable format.
toggleButton ( string $action, string $select_name, array $options, string $callback ) : string Creates an AJAX sliding toggle button (or and equivalent form when AJAX is disabled)
unQuote ( string $quoted_string, string $quote = null ) : string removes quotes (',",`) from a quoted string
unescapeMysqlWildcards ( string $name ) : string removes slashes before "_" and "%" characters Note: This function does not unescape backslashes!
unsupportedDatatypes ( ) : array Returns a list of datatypes that are not (yet) handled by PMA.
userDir ( string $dir ) : string replaces %u in given path with current user name
whichCrlf ( ) : string Defines the value depending on the user OS.

비공개 메소드들

메소드 설명
_checkRowCount ( string $db, array $table ) : integer Check the correct row count
_generateRowQueryOutput ( string $sqlQuery ) : string Execute an EXPLAIN query and formats results similar to MySQL command line utility.

메소드 상세

addMicroseconds() 공개 정적인 메소드

If the string contains fractional seconds, pads it with 0s up to 6 decimal places.
public static addMicroseconds ( string $value ) : string
$value string time, datetime or timestamp strings
리턴 string time, datetime or timestamp strings with fractional seconds

asWKT() 공개 정적인 메소드

Converts GIS data to Well Known Text format
public static asWKT ( string $data, boolean $includeSRID = false ) : string
$data string GIS data
$includeSRID boolean Add SRID to the WKT
리턴 string GIS data in Well Know Text format

backquote() 공개 정적인 메소드

and escapes backquotes inside the name with another backquote example: echo backquote('owners db'); // owners db
public static backquote ( mixed $a_name, boolean $do_it = true ) : mixed
$a_name mixed the database, table or field name to "backquote" or array of it
$do_it boolean a flag to bypass this function (used by dump functions)
리턴 mixed the "backquoted" database, table or field name

backquoteCompat() 공개 정적인 메소드

in compatibility mode example: echo backquoteCompat('owners db'); // owners db
public static backquoteCompat ( mixed $a_name, string $compatibility = 'MSSQL', boolean $do_it = true ) : mixed
$a_name mixed the database, table or field name to "backquote" or array of it
$compatibility string string compatibility mode (used by dump functions)
$do_it boolean a flag to bypass this function (used by dump functions)
리턴 mixed the "backquoted" database, table or field name

buildActionTitles() 공개 정적인 메소드

Build titles and icons for action links
public static buildActionTitles ( ) : array
리턴 array the action titles

cacheExists() 공개 정적인 메소드

Verifies if something is cached in the session
public static cacheExists ( string $var ) : boolean
$var string variable name
리턴 boolean

cacheGet() 공개 정적인 메소드

Gets cached information from the session
public static cacheGet ( string $var, Closure $callback = null ) : mixed
$var string variable name
$callback Closure callback to fetch the value
리턴 mixed

cacheSet() 공개 정적인 메소드

Caches information in the session
public static cacheSet ( string $var, mixed $val = null ) : mixed
$var string variable name
$val mixed value
리턴 mixed

cacheUnset() 공개 정적인 메소드

Removes cached information from the session
public static cacheUnset ( string $var ) : void
$var string variable name
리턴 void

checkParameters() 공개 정적인 메소드

Called by each script that needs parameters, it displays an error message and, by default, stops the execution. Not sure we could use a strMissingParameter message here, would have to check if the error message file is always available
public static checkParameters ( string[] $params, boolean $request = true ) : void
$params string[] The names of the parameters needed by the calling script
$request boolean Whether to include this list in checking for special params
리턴 void

clearUserCache() 공개 정적인 메소드

Clears cache content which needs to be refreshed on user change.
public static clearUserCache ( ) : void
리턴 void

configureCurl() 공개 정적인 메소드

Updates an existing curl as necessary
public static configureCurl ( resource $curl_handle ) : resource
$curl_handle resource A curl_handle resource created by curl_init which should have several options set
리턴 resource curl_handle with updated options

containsNonPrintableAscii() 공개 정적인 메소드

Verifies whether the value contains a non-printable character
public static containsNonPrintableAscii ( string $value ) : integer
$value string value
리턴 integer

convertBitDefaultValue() 공개 정적인 메소드

Converts a BIT type default value for example, b'010' becomes 010
public static convertBitDefaultValue ( string $bit_default_value ) : string
$bit_default_value string value
리턴 string the converted value

createGISData() 공개 정적인 메소드

Generates GIS data based on the string passed.
public static createGISData ( string $gis_string ) : string
$gis_string string GIS string
리턴 string GIS data enclosed in 'GeomFromText' function

currentUserHasPrivilege() 공개 정적인 메소드

Example: currentUserHasPrivilege('CREATE ROUTINE', 'mydb'); Checks if the currently logged in user has the global 'CREATE ROUTINE' privilege or, if not, checks if the user has this privilege on database 'mydb'.
public static currentUserHasPrivilege ( string $priv, mixed $db = null, mixed $tbl = null ) : boolean
$priv string The privilege to check
$db mixed null, to only check global privileges string, db name where to also check for privileges
$tbl mixed null, to only check global/db privileges string, table name where to also check for privileges
리턴 boolean

duplicateFirstNewline() 공개 정적인 메소드

If the string starts with a \r\n pair (0x0d0a) add an extra \n
public static duplicateFirstNewline ( string $string ) : string
$string string string
리턴 string with the chars replaced

escapeMysqlWildcards() 공개 정적인 메소드

Note: This function does not escape backslashes!
public static escapeMysqlWildcards ( string $name ) : string
$name string the string to escape
리턴 string the escaped string

expandUserString() 공개 정적인 메소드

Formats user string, expanding @VARIABLES@, accepting strftime format string.
public static expandUserString ( string $string, array | string $escape = null, array $updates = [] ) : string
$string string Text where to do expansion.
$escape array | string Function to call for escaping variable values. Can also be an array of: - the escape method name - the class that contains the method - location of the class (for inclusion)
$updates array Array with overrides for default parameters (obtained from GLOBALS).
리턴 string

extractColumnSpec() 공개 정적인 메소드

Extracts the various parts from a column spec
public static extractColumnSpec ( string $columnspec ) : array
$columnspec string Column specification
리턴 array associative array containing type, spec_in_brackets and possibly enum_set_values (another array)

extractValueFromFormattedSize() 공개 정적인 메소드

Returns the number of bytes when a formatted size is given
public static extractValueFromFormattedSize ( string $formatted_size ) : integer
$formatted_size string the size expression (for example 8MB)
리턴 integer The numerical part of the expression (for example 8)

formatByteDown() 공개 정적인 메소드

Formats $value to byte view
public static formatByteDown ( double | integer $value, integer $limes = 6, integer $comma ) : array
$value double | integer the value to format
$limes integer the sensitiveness
$comma integer the number of decimals to retain
리턴 array the formatted value and its unit

formatNumber() 공개 정적인 메소드

examples: echo formatNumber(123456789, 6); // 123,457 k echo formatNumber(-123456789, 4, 2); // -123.46 M echo formatNumber(-0.003, 6); // -3 m echo formatNumber(0.003, 3, 3); // 0.003 echo formatNumber(0.00003, 3, 2); // 0.03 m echo formatNumber(0, 6); // 0
public static formatNumber ( double $value, integer $digits_left = 3, integer $digits_right, boolean $only_down = false, boolean $noTrailingZero = true ) : string
$value double the value to format
$digits_left integer number of digits left of the comma
$digits_right integer number of digits right of the comma
$only_down boolean do not reformat numbers below 1
$noTrailingZero boolean removes trailing zeros right of the comma (default: true)
리턴 string the formatted value and its unit

formatSql() 공개 정적인 메소드

format sql strings
public static formatSql ( string $sqlQuery, boolean $truncate = false ) : string
$sqlQuery string raw SQL string
$truncate boolean truncate the query if it is too long
리턴 string the formatted sql

generateHiddenMaxFileSize() 공개 정적인 메소드

Generates a hidden field which should indicate to the browser the maximum size for upload
public static generateHiddenMaxFileSize ( integer $max_size ) : string
$max_size integer the size
리턴 string the INPUT field

getBrowseUploadFileBlock() 공개 정적인 메소드

Prepare the form used to browse anywhere on the local server for a file to import
public static getBrowseUploadFileBlock ( string $max_upload_size ) : String
$max_upload_size string maximum upload size
리턴 String

getButton() 공개 정적인 메소드

Prepare HTML code for display button.
public static getButton ( ) : String
리턴 String

getButtonOrImage() 공개 정적인 메소드

Generate a button or image tag
public static getButtonOrImage ( string $button_name, string $button_class, string $text, string $image, string $value = '' ) : string
$button_name string name of button element
$button_class string class of button or image element
$text string text to display
$image string image to display
$value string value
리턴 string html content

getCharsetQueryPart() 정적인 공개 메소드

Generate the charset query part
static public getCharsetQueryPart ( string $collation, $override = false ) : string
$collation string Collation
리턴 string

getClassForType() 공개 정적인 메소드

Returns the proper class clause according to the column type
public static getClassForType ( string $type ) : string
$type string the column type
리턴 string $class_clause the HTML class clause

getCollateForIS() 공개 정적인 메소드

Provide COLLATE clause, if required, to perform case sensitive comparisons for queries on information_schema.
public static getCollateForIS ( ) : string
리턴 string COLLATE clause if needed or empty string.

getCompressionMimeType() 공개 정적인 메소드

Reads the file, detects the compression MIME type, closes the file and returns the MIME type
public static getCompressionMimeType ( resource $file ) : string
$file resource the file handle
리턴 string the MIME type for compression, or 'none'

getDbInfo() 공개 정적인 메소드

Gets the list of tables in the current db and information about these tables if possible
public static getDbInfo ( string $db, string $sub_part ) : array
$db string database name
$sub_part string part of script name
리턴 array

getDefaultFunctionForField() 공개 정적인 메소드

Returns default function for a particular column.
public static getDefaultFunctionForField ( array $field, boolean $insert_mode ) : string
$field array Data about the column for which to generate the dropdown
$insert_mode boolean Whether the operation is 'insert'
리턴 string An HTML snippet of a dropdown list with function names appropriate for the requested column.

getDivForSliderEffect() 공개 정적인 메소드

Generates a slider effect (jQjuery) Takes care of generating the initial
and the link controlling the slider; you have to generate the
yourself after the sliding section.
public static getDivForSliderEffect ( string $id = '', string $message = '' ) : string
$id string the id of the
on which to apply the effect
$message string the message to show as a link
리턴 string html div element

getDropdown() 공개 정적인 메소드

Generates and returns an HTML dropdown
public static getDropdown ( string $select_name, array $choices, string $active_choice, string $id, string $class = '', string $placeholder = null ) : string
$select_name string name for the select element
$choices array choices values
$active_choice string the choice to select by default
$id string id of the select element; can be different in case the dropdown is present more than once on the page
$class string class for the select element
$placeholder string Placeholder for dropdown if nothing else is selected
리턴 string html content

getExternalBug() 공개 정적인 메소드

Prepare a lightbulb hint explaining a known external bug that affects a functionality
public static getExternalBug ( string $functionality, string $component, string $minimum_version, string $bugref ) : String
$functionality string localized message explaining the func.
$component string 'mysql' (eventually, 'php')
$minimum_version string of this component
$bugref string bug reference for this component
리턴 String

getFKCheckbox() 공개 정적인 메소드

Get HTML for Foreign key check checkbox
public static getFKCheckbox ( ) : string
리턴 string HTML for checkbox

getFirstOccurringRegularExpression() 공개 정적인 메소드

Get regular expression which occur first inside the given sql query.
public static getFirstOccurringRegularExpression ( array $regex_array, String $query ) : String
$regex_array array Comparing regular expressions.
$query String SQL query to be checked.
리턴 String Matching regular expression.

getFormattedMaximumUploadSize() 공개 정적인 메소드

Returns the formatted maximum size for an upload
public static getFormattedMaximumUploadSize ( integer $max_upload_size ) : string
$max_upload_size integer the size
리턴 string the message

getFunctionsForField() 공개 정적인 메소드

Creates a dropdown box with MySQL functions for a particular column.
public static getFunctionsForField ( array $field, boolean $insert_mode, $foreignData ) : string
$field array Data about the column for which to generate the dropdown
$insert_mode boolean Whether the operation is 'insert'
리턴 string An HTML snippet of a dropdown list with function names appropriate for the requested column.

getGISDatatypes() 공개 정적인 메소드

Return GIS data types
public static getGISDatatypes ( boolean $upper_case = false ) : string[]
$upper_case boolean whether to return values in upper case
리턴 string[] GIS data types

getGISFunctions() 공개 정적인 메소드

Returns the names and details of the functions that can be applied on geometry data types.
public static getGISFunctions ( string $geom_type = null, boolean $binary = true, boolean $display = false ) : array
$geom_type string if provided the output is limited to the functions that are applicable to the provided geometry type.
$binary boolean if set to false functions that take two geometries as arguments will not be included.
$display boolean if set to true separators will be added to the output array.
리턴 array names and details of the functions that can be applied on geometry data types.

getHtmlTab() 공개 정적인 메소드

If the variables $link and $args ar left empty, an inactive tab is created
public static getHtmlTab ( array $tab, array $url_params = [] ) : string
$tab array array with all options
$url_params array tab specific URL parameters
리턴 string html code for one tab, a link if valid otherwise a span

getHtmlTabs() 공개 정적인 메소드

returns html-code for a tab navigation
public static getHtmlTabs ( array $tabs, array $url_params, string $menu_id, boolean $resizable = false ) : string
$tabs array one element per tab
$url_params array additional URL parameters
$menu_id string HTML id attribute for the menu container
$resizable boolean whether to add a "resizable" class
리턴 string html-code for tab-navigation

getIcon() 공개 정적인 메소드

This function takes into account the ActionLinksMode configuration setting and wraps the image tag in a span tag.
public static getIcon ( string $icon, string $alternate = '', boolean $force_text = false, boolean $menu_icon = false, string $control_param = 'ActionLinksMode' ) : string
$icon string name of icon file
$alternate string alternate text
$force_text boolean whether to force alternate text to be displayed
$menu_icon boolean whether this icon is for the menu bar or not
$control_param string which directive controls the display
리턴 string an html snippet

getImage() 공개 정적인 메소드

Returns an HTML IMG tag for a particular image from a theme, which may be an actual file or an icon from a sprite
public static getImage ( string $image, string $alternate = '', array $attributes = [] ) : string
$image string The name of the file to get
$alternate string Used to set 'alt' and 'title' attributes of the image
$attributes array An associative array of other attributes
리턴 string an html IMG tag

getListNavigator() 공개 정적인 메소드

Prepare navigation for a list
public static getListNavigator ( integer $count, integer $pos, array $_url_params, string $script, string $frame, integer $max_count, string $name = 'pos', string[] $classes = [] ) : string
$count integer number of elements in the list
$pos integer current position in the list
$_url_params array url parameters
$script string script name for form target
$frame string target frame
$max_count integer maximum number of elements to display from the list
$name string the name for the request parameter
$classes string[] additional classes for the container
리턴 string $list_navigator_html the html content

getMenuTabList() 공개 정적인 메소드

Return the list of tabs for the menu with corresponding names
public static getMenuTabList ( string $level = null ) : array
$level string 'server', 'db' or 'table' level
리턴 array list of tabs for the menu

getMessage() 공개 정적인 메소드

Prepare the message and the query usually the message is the result of the query executed
public static getMessage ( Message | string $message, string $sql_query = null, string $type = 'notice' ) : string
$message Message | string the message to display
$sql_query string the query to display
$type string the type (level) of the message
리턴 string

getMySQLDocuURL() 공개 정적인 메소드

Get a URL link to the official MySQL documentation
public static getMySQLDocuURL ( string $link, string $anchor = '' ) : string
$link string contains name of page/anchor that is being linked
$anchor string anchor to page part
리턴 string the URL link

getRadioFields() 공개 정적인 메소드

Generates a set of radio HTML fields
public static getRadioFields ( string $html_field_name, array $choices, string $checked_choice = '', boolean $line_break = true, boolean $escape_label = true, string $class = '', string $id_prefix = '' ) : string
$html_field_name string the radio HTML field
$choices array the choices values and labels
$checked_choice string the choice to check by default
$line_break boolean whether to add HTML line break after a choice
$escape_label boolean whether to use htmlspecialchars() on label
$class string enclose each choice with a div of this class
$id_prefix string prefix for the id attribute, name will be used if this is not supplied
리턴 string set of html radio fiels

getScriptNameForOption() 공개 정적인 메소드

Get the script name corresponding to a plain English config word in order to append in links on navigation and main panel
public static getScriptNameForOption ( string $target, string $location ) : string
$target string a valid value for $cfg['NavigationTreeDefaultTabTable'], $cfg['NavigationTreeDefaultTabTable2'], $cfg['DefaultTabTable'], $cfg['DefaultTabDatabase'] or $cfg['DefaultTabServer']
$location string one out of 'server', 'table', 'database'
리턴 string script name corresponding to the config word

getSelectUploadFileBlock() 공개 정적인 메소드

Prepare the form used to select a file to import from the server upload directory
public static getSelectUploadFileBlock ( ImportPlugin[] $import_list, string $uploaddir ) : String
$import_list PMA\libraries\plugins\ImportPlugin[] array of import plugins
$uploaddir string upload directory
리턴 String

getServerType() 공개 정적인 메소드

Known types are: MariaDB and MySQL (default)
public static getServerType ( ) : string
리턴 string

getStartAndNumberOfRowsPanel() 공개 정적인 메소드

Function to get html for the start row and number of rows panel
public static getStartAndNumberOfRowsPanel ( string $sql_query ) : string
$sql_query string sql query
리턴 string html

getSupportedDatatypes() 공개 정적인 메소드

This function processes the datatypes supported by the DB, as specified in Types->getColumns() and either returns an array (useful for quickly checking if a datatype is supported) or an HTML snippet that creates a drop-down list.
public static getSupportedDatatypes ( boolean $html = false, string $selected = '' ) : mixed
$html boolean Whether to generate an html snippet or an array
$selected string The value to mark as selected in HTML mode
리턴 mixed An HTML snippet or an array of datatypes.

getTableList() 공개 정적인 메소드

returns array with tables of given db with extended information and grouped
public static getTableList ( string $db, string $tables = null, integer $limit_offset, integer | boolean $limit_count = false ) : array
$db string name of db
$tables string name of tables
$limit_offset integer list offset
$limit_count integer | boolean max tables to return
리턴 array (recursive) grouped table list

getTablesWhenOpen() 공개 정적인 메소드

Gets the list of tables in the current db, taking into account that they might be "in use"
public static getTablesWhenOpen ( string $db, object $db_info_result ) : array
$db string database name
$db_info_result object result set
리턴 array $tables list of tables

getTitleForTarget() 공개 정적인 메소드

Get the action word corresponding to a script name in order to display it as a title in navigation panel
public static getTitleForTarget ( string $target ) : string
$target string a valid value for $cfg['NavigationTreeDefaultTabTable'], $cfg['NavigationTreeDefaultTabTable2'], $cfg['DefaultTabTable'] or $cfg['DefaultTabDatabase']
리턴 string Title for the $cfg value

getUniqueCondition() 공개 정적인 메소드

Function to generate unique condition for specified row.
public static getUniqueCondition ( resource $handle, integer $fields_cnt, array $fields_meta, array $row, boolean $force_unique = false, string | boolean $restrict_to_table = false, array $analyzed_sql_results = null ) : array
$handle resource current query result
$fields_cnt integer number of fields
$fields_meta array meta information about fields
$row array current row
$force_unique boolean generate condition only on pk or unique
$restrict_to_table string | boolean restrict the unique condition to this table or false if none
$analyzed_sql_results array the analyzed query
리턴 array the calculated condition and whether condition is unique

handleContext() 공개 정적인 메소드

Returns information with regards to handling the http request
public static handleContext ( array $context ) : array
$context array Data about the context for which to http request is sent
리턴 array of updated context information

handleDisableFKCheckCleanup() 공개 정적인 메소드

Cleanup changes done for foreign key check
public static handleDisableFKCheckCleanup ( boolean $default_fk_check_value ) : void
$default_fk_check_value boolean original value for 'FOREIGN_KEY_CHECKS'
리턴 void

handleDisableFKCheckInit() 공개 정적인 메소드

Handle foreign key check request
public static handleDisableFKCheckInit ( ) : boolean
리턴 boolean Default foreign key checks value

httpRequest() 공개 정적인 메소드

Creates HTTP request
public static httpRequest ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed
$url string Url to send the request
$method string HTTP request method (GET, POST, PUT, DELETE, etc)
$return_only_status boolean If set to true, the method would only return response status
$content mixed Content to be sent with HTTP request
$header string Header to be set for the HTTP request
리턴 mixed

httpRequestCurl() 공개 정적인 메소드

Creates HTTP request using curl
public static httpRequestCurl ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed
$url string Url to send the request
$method string HTTP request method (GET, POST, PUT, DELETE, etc)
$return_only_status boolean If set to true, the method would only return response status
$content mixed Content to be sent with HTTP request
$header string Header to be set for the HTTP request
리턴 mixed

httpRequestFopen() 공개 정적인 메소드

Creates HTTP request using file_get_contents
public static httpRequestFopen ( string $url, string $method, boolean $return_only_status = false, mixed $content = null, string $header = "" ) : mixed
$url string Url to send the request
$method string HTTP request method (GET, POST, PUT, DELETE, etc)
$return_only_status boolean If set to true, the method would only return response status
$content mixed Content to be sent with HTTP request
$header string Header to be set for the HTTP request
리턴 mixed

httpRequestReturn() 공개 정적인 메소드

Creates HTTP request using curl
public static httpRequestReturn ( mixed $response, interger $http_status, boolean $return_only_status ) : mixed
$response mixed HTTP response
$http_status interger HTTP response status code
$return_only_status boolean If set to true, the method would only return response status
리턴 mixed

isForeignKeyCheck() 공개 정적인 메소드

Is Foreign key check enabled?
public static isForeignKeyCheck ( ) : boolean
리턴 boolean

isForeignKeySupported() 공개 정적인 메소드

Verifies if this table's engine supports foreign keys
public static isForeignKeySupported ( string $engine ) : boolean
$engine string engine
리턴 boolean

isVirtualColumnsSupported() 공개 정적인 메소드

Returns whether the database server supports virtual columns
public static isVirtualColumnsSupported ( ) : boolean
리턴 boolean

linkOrButton() 공개 정적인 메소드

Displays a link, or a button if the link's URL is too large, to accommodate some browsers' limitations
public static linkOrButton ( string $url, string $message, mixed $tag_params = [], boolean $new_form = true, boolean $strip_img = false, string $target = '', boolean $force_button = false ) : string
$url string the URL
$message string the link message
$tag_params mixed string: js confirmation array: additional tag params (f.e. style="")
$new_form boolean we set this to false when we are already in a form, to avoid generating nested forms
$strip_img boolean whether to strip the image
$target string target
$force_button boolean use a button even when the URL is not too long
리턴 string the results to be echoed or saved in an array

listPHPExtensions() 공개 정적인 메소드

Returs list of used PHP extensions.
public static listPHPExtensions ( ) : array
리턴 array of strings

localisedDate() 공개 정적인 메소드

Writes localised date
public static localisedDate ( integer $timestamp, string $format = '' ) : string
$timestamp integer the current timestamp
$format string format
리턴 string the formatted date

mysqlDie() 공개 정적인 메소드

Returns the error message otherwise.
public static mysqlDie ( string | boolean $server_msg = '', string $sql_query = '', boolean $is_modify_link = true, string $back_url = '', boolean $exit = true ) : string
$server_msg string | boolean Server's error message.
$sql_query string The SQL query that failed.
$is_modify_link boolean Whether to show a "modify" link or not.
$back_url string URL for the "back" link (full path is not required).
$exit boolean Whether execution should be stopped or the error message should be returned.
리턴 string

pageselector() 공개 정적인 메소드

Generate a pagination selector for browsing resultsets
public static pageselector ( string $name, integer $rows, integer $pageNow = 1, integer $nbTotalPage = 1, integer $showAll = 200, integer $sliceStart = 5, integer $sliceEnd = 5, integer $percent = 20, integer $range = 10, string $prompt = '' ) : string
$name string The name for the request parameter
$rows integer Number of rows in the pagination set
$pageNow integer current page number
$nbTotalPage integer number of total pages
$showAll integer If the number of pages is lower than this variable, no pages will be omitted in pagination
$sliceStart integer How many rows at the beginning should always be shown?
$sliceEnd integer How many rows at the end should always be shown?
$percent integer Percentage of calculation page offsets to hop to a next page
$range integer Near the current page, how many pages should be considered "nearby" and displayed as well?
$prompt string The prompt to display (sometimes empty)
리턴 string

parseEnumSetValues() 공개 정적인 메소드

Parses ENUM/SET values
public static parseEnumSetValues ( string $definition, boolean $escapeHtml = true ) : array
$definition string The definition of the column for which to parse the values
$escapeHtml boolean Whether to escape html entities
리턴 array

printableBitValue() 공개 정적인 메소드

Converts a bit value to printable format; in MySQL a BIT field can be from 1 to 64 bits so we need this function because in PHP, decbin() supports only 32 bits on 32-bit servers
public static printableBitValue ( integer $value, integer $length ) : string
$value integer coming from a BIT field
$length integer length
리턴 string the printable value

processIndexData() 공개 정적인 메소드

Process the index data.
public static processIndexData ( array $indexes ) : array
$indexes array index data
리턴 array processes index data

profilingSupported() 공개 정적인 메소드

Verifies if current MySQL server supports profiling
public static profilingSupported ( ) : boolean
리턴 boolean whether profiling is supported

requestString() 공개 정적인 메소드

Converts given (request) paramter to string
public static requestString ( mixed $value ) : string
$value mixed Value to convert
리턴 string

showDocu() 공개 정적인 메소드

Displays a link to the phpMyAdmin documentation
public static showDocu ( string $page, string $anchor = '', boolean $bbcode = false ) : string
$page string Page in documentation
$anchor string Optional anchor in page
$bbcode boolean Optional flag indicating whether to output bbcode
리턴 string the html link

showHint() 공개 정적인 메소드

Returns HTML code for a tooltip
public static showHint ( string $message ) : string
$message string the message for the tooltip
리턴 string

showIcons() 공개 정적인 메소드

Checks whether configuration value tells to show icons.
public static showIcons ( string $value ) : boolean
$value string Configuration option name
리턴 boolean Whether to show icons.

showMySQLDocu() 공개 정적인 메소드

Displays a link to the official MySQL documentation
public static showMySQLDocu ( string $link, boolean $big_icon = false, string $anchor = '', boolean $just_open = false ) : string
$link string contains name of page/anchor that is being linked
$big_icon boolean whether to use big icon (like in left frame)
$anchor string anchor to page part
$just_open boolean whether only the opening tag should be returned
리턴 string the html link

showPHPDocu() 공개 정적인 메소드

Displays a link to the PHP documentation
public static showPHPDocu ( string $target ) : string
$target string anchor in documentation
리턴 string the html link

showText() 공개 정적인 메소드

Checks whether configuration value tells to show text.
public static showText ( string $value ) : boolean
$value string Configuration option name
리턴 boolean Whether to show text.

splitURLQuery() 공개 정적인 메소드

Splits a URL string by parameter
public static splitURLQuery ( string $url ) : array
$url string the URL
리턴 array the parameter/value pairs, for example [0] db=sakila

timespanFormat() 공개 정적인 메소드

Returns a given timespan value in a readable format.
public static timespanFormat ( integer $seconds ) : string
$seconds integer the timespan
리턴 string the formatted value

toggleButton() 공개 정적인 메소드

Creates an AJAX sliding toggle button (or and equivalent form when AJAX is disabled)
public static toggleButton ( string $action, string $select_name, array $options, string $callback ) : string
$action string The URL for the request to be executed
$select_name string The name for the dropdown box
$options array An array of options (see rte_footer.lib.php)
$callback string A JS snippet to execute when the request is successfully processed
리턴 string HTML code for the toggle button

unQuote() 공개 정적인 메소드

checks if the string is quoted and removes this quotes
public static unQuote ( string $quoted_string, string $quote = null ) : string
$quoted_string string string to remove quotes from
$quote string type of quote to remove
리턴 string unqoted string

unescapeMysqlWildcards() 공개 정적인 메소드

removes slashes before "_" and "%" characters Note: This function does not unescape backslashes!
public static unescapeMysqlWildcards ( string $name ) : string
$name string the string to escape
리턴 string the escaped string

unsupportedDatatypes() 공개 정적인 메소드

Used by: tbl_change.php and libraries/db_routines.inc.php
public static unsupportedDatatypes ( ) : array
리턴 array list of datatypes

userDir() 공개 정적인 메소드

example: $user_dir = userDir('/var/pma_tmp/%u/'); // '/var/pma_tmp/root/'
public static userDir ( string $dir ) : string
$dir string with wildcard for user
리턴 string per user directory

whichCrlf() 공개 정적인 메소드

Defines the value depending on the user OS.
public static whichCrlf ( ) : string
리턴 string the value to use