本文整理汇总了PHP中PMA_Bookmark_get函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Bookmark_get函数的具体用法?PHP PMA_Bookmark_get怎么用?PHP PMA_Bookmark_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_Bookmark_get函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMA_Bookmark_get
/**
* Test for PMA_Bookmark_get
*
* @return void
*/
public function testPMA_Bookmark_get()
{
$this->assertEquals(
'',
PMA_Bookmark_get('phpmyadmin', '1')
);
}
示例2: testPMA_Bookmark_get
/**
* Test for PMA_Bookmark_get
*/
public function testPMA_Bookmark_get(){
if (! function_exists('PMA_DBI_fetch_value')) {
function PMA_DBI_fetch_value()
{
return '';
}
}
$this->assertEquals(
'',
PMA_Bookmark_get('phpmyadmin', '1')
);
}
示例3: PMA_getDefaultSqlQueryForBrowse
/**
* Function to get the default sql query for browsing page
*
* @param String $db the current database
* @param String $table the current table
*
* @return String $sql_query the default $sql_query for browse page
*/
function PMA_getDefaultSqlQueryForBrowse($db, $table)
{
include_once 'libraries/bookmark.lib.php';
$book_sql_query = PMA_Bookmark_get($db, '\'' . PMA_Util::sqlAddSlashes($table) . '\'', 'label', false, true);
if (!empty($book_sql_query)) {
$GLOBALS['using_bookmark_message'] = PMA_message::notice(__('Using bookmark "%s" as default browse query.'));
$GLOBALS['using_bookmark_message']->addParam($table);
$GLOBALS['using_bookmark_message']->addMessage(PMA_Util::showDocu('faq', 'faq6-22'));
$sql_query = $book_sql_query;
} else {
$defaultOrderByClause = '';
if (isset($GLOBALS['cfg']['TablePrimaryKeyOrder']) && $GLOBALS['cfg']['TablePrimaryKeyOrder'] !== 'NONE') {
$primaryKey = null;
$primary = PMA_Index::getPrimary($table, $db);
if ($primary !== false) {
$primarycols = $primary->getColumns();
foreach ($primarycols as $col) {
$primaryKey = $col->getName();
break;
}
if ($primaryKey != null) {
$defaultOrderByClause = ' ORDER BY ' . PMA_Util::backquote($table) . '.' . PMA_Util::backquote($primaryKey) . ' ' . $GLOBALS['cfg']['TablePrimaryKeyOrder'];
}
}
}
$sql_query = 'SELECT * FROM ' . PMA_Util::backquote($table) . $defaultOrderByClause;
}
unset($book_sql_query);
return $sql_query;
}
示例4: preg_replace
if (isset($bookmark_variable) && !empty($bookmark_variable)) {
$import_text = preg_replace('|/\\*(.*)\\[VARIABLE\\](.*)\\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $import_text);
}
// refresh left frame on changes in table or db structure
if (preg_match('/^(CREATE|ALTER|DROP)\\s+(VIEW|TABLE|DATABASE|SCHEMA)\\s+/i', $import_text)) {
$GLOBALS['reload'] = true;
}
break;
case 1:
// bookmarked query that have to be displayed
$import_text = PMA_Bookmark_get($db, $id_bookmark);
$run_query = FALSE;
break;
case 2:
// bookmarked query that have to be deleted
$import_text = PMA_Bookmark_get($db, $id_bookmark);
PMA_Bookmark_delete($db, $id_bookmark);
$run_query = FALSE;
$error = TRUE;
// this is kind of hack to skip processing the query
break;
}
}
// end bookmarks reading
// Do no run query if we show PHP code
if (isset($GLOBALS['show_as_php'])) {
$run_query = FALSE;
$go_sql = TRUE;
}
// Store the query as a bookmark before executing it if bookmarklabel was given
if (!empty($bkm_label) && !empty($import_text)) {
示例5: PMA_generate_common_url
$err_url = (!empty($back) ? $back : $goto) . '?' . PMA_generate_common_url($db) . (strpos(' ' . $goto, 'db_') != 1 && strlen($table) ? '&table=' . urlencode($table) : '');
}
// end if
// Coming from a bookmark dialog
if (isset($fields['query'])) {
$sql_query = $fields['query'];
}
// This one is just to fill $db
if (isset($fields['dbase'])) {
$db = $fields['dbase'];
}
// Default to browse if no query set and we have table
// (needed for browsing from DefaultTabTable)
if (empty($sql_query) && strlen($table) && strlen($db)) {
require_once './libraries/bookmark.lib.php';
$book_sql_query = PMA_Bookmark_get($db, '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
if (!empty($book_sql_query)) {
$sql_query = $book_sql_query;
} else {
$sql_query = 'SELECT * FROM ' . PMA_backquote($table);
}
unset($book_sql_query);
// set $goto to what will be displayed if query returns 0 rows
$goto = 'tbl_structure.php';
} else {
// Now we can check the parameters
PMA_checkParameters(array('sql_query'));
}
// instead of doing the test twice
$is_drop_database = preg_match('/DROP[[:space:]]+(DATABASE|SCHEMA)[[:space:]]+/i', $sql_query);
/**
示例6: PMA_getDefaultSqlQueryForBrowse
/**
* Function to get the default sql query for browsing page
*
* @param String $db the current database
* @param String $table the current table
*
* @return String $sql_query the default $sql_query for browse page
*/
function PMA_getDefaultSqlQueryForBrowse($db, $table)
{
include_once 'libraries/bookmark.lib.php';
$book_sql_query = PMA_Bookmark_get($db, '\'' . PMA_Util::sqlAddSlashes($table) . '\'', 'label', false, true);
if (!empty($book_sql_query)) {
$GLOBALS['using_bookmark_message'] = PMA_message::notice(__('Using bookmark "%s" as default browse query.'));
$GLOBALS['using_bookmark_message']->addParam($table);
$GLOBALS['using_bookmark_message']->addMessage(PMA_Util::showDocu('faq', 'faq6-22'));
$sql_query = $book_sql_query;
} else {
$sql_query = 'SELECT * FROM ' . PMA_Util::backquote($table);
}
unset($book_sql_query);
return $sql_query;
}
示例7: PMA_Bookmark_get
}
}
$response = PMA_Response::getInstance();
$response->isSuccess($retval == true);
exit;
}
// Default to browse if no query set and we have table
// (needed for browsing from DefaultTabTable)
if (empty($sql_query) && strlen($table) && strlen($db)) {
include_once 'libraries/bookmark.lib.php';
$book_sql_query = PMA_Bookmark_get(
$db,
'\'' . $common_functions->sqlAddSlashes($table) . '\'',
'label',
false,
true
);
if (! empty($book_sql_query)) {
$GLOBALS['using_bookmark_message'] = PMA_message::notice(
__(
'Using bookmark "%s" as default browse query.'
)
);
$GLOBALS['using_bookmark_message']->addParam($table);
$GLOBALS['using_bookmark_message']->addMessage(
$common_functions->showDocu('faq6_22')
);
$sql_query = $book_sql_query;