本文整理汇总了PHP中PMA_getDataForDBInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getDataForDBInfo函数的具体用法?PHP PMA_getDataForDBInfo怎么用?PHP PMA_getDataForDBInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getDataForDBInfo函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
$strPrivDescReplClient = __('Allows the user to ask where the slaves / masters are.');
$strPrivDescReplSlave = __('Needed for the replication slaves.');
$strPrivDescSelect = __('Allows reading data.');
$strPrivDescShowDb = __('Gives access to the complete list of databases.');
$strPrivDescShowView = __('Allows performing SHOW CREATE VIEW queries.');
$strPrivDescShutdown = __('Allows shutting down the server.');
$strPrivDescSuper = __('Allows connecting, even if maximum number of connections is reached; ' . 'required for most administrative operations like setting global variables ' . 'or killing threads of other users.');
$strPrivDescTrigger = __('Allows creating and dropping triggers.');
$strPrivDescUpdate = __('Allows changing data.');
$strPrivDescUsage = __('No privileges.');
$_add_user_error = false;
/**
* Get DB information: username, hostname, dbname,
* tablename, db_and_table, dbname_is_wildcard
*/
list($username, $hostname, $dbname, $tablename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
/**
* Checks if the user is allowed to do what he tries to...
*/
if (!$GLOBALS['is_superuser'] && !$GLOBALS['is_grantuser'] && !$GLOBALS['is_createuser']) {
$response->addHTML(PMA_getHtmlForSubPageHeader('privileges', '', false));
$response->addHTML(PMA_Message::error(__('No Privileges'))->getDisplay());
exit;
}
/**
* Checks if the user is using "Change Login Information / Copy User" dialog
* only to update the password
*/
if (isset($_REQUEST['change_copy']) && $username == $_REQUEST['old_username'] && $hostname == $_REQUEST['old_hostname']) {
$response->addHTML(PMA_Message::error(__('Username and hostname didn\'t change.'))->getDisplay());
$response->isSuccess(false);
示例2: testPMAGetDataForDBInfo
/**
* Test for PMA_getDataForDBInfo
*
* @return void
*/
public function testPMAGetDataForDBInfo()
{
$_REQUEST['username'] = "PMA_username";
$_REQUEST['hostname'] = "PMA_hostname";
$_REQUEST['tablename'] = "PMA_tablename";
$_REQUEST['dbname'] = "PMA_dbname";
list($username, $hostname, $dbname, $tablename, $routinename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
$this->assertEquals("PMA_username", $username);
$this->assertEquals("PMA_hostname", $hostname);
$this->assertEquals("PMA_dbname", $dbname);
$this->assertEquals("PMA_tablename", $tablename);
$this->assertEquals("`PMA_dbname`.`PMA_tablename`", $db_and_table);
$this->assertEquals(true, $dbname_is_wildcard);
//pre variable have been defined
$_REQUEST['pred_tablename'] = "PMA_pred__tablename";
$_REQUEST['pred_dbname'] = array("PMA_pred_dbname");
list(, , $dbname, $tablename, $routinename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
$this->assertEquals("PMA_pred_dbname", $dbname);
$this->assertEquals("PMA_pred__tablename", $tablename);
$this->assertEquals("`PMA_pred_dbname`.`PMA_pred__tablename`", $db_and_table);
$this->assertEquals(true, $dbname_is_wildcard);
}
示例3: __
. 'required for most administrative operations like setting global variables '
. 'or killing threads of other users.'
);
$strPrivDescTrigger = __('Allows creating and dropping triggers.');
$strPrivDescUpdate = __('Allows changing data.');
$strPrivDescUsage = __('No privileges.');
$_add_user_error = false;
/**
* Get DB information: username, hostname, dbname,
* tablename, db_and_table, dbname_is_wildcard
*/
list(
$username, $hostname, $dbname, $tablename, $routinename,
$db_and_table, $dbname_is_wildcard
) = PMA_getDataForDBInfo();
/**
* Checks if the user is allowed to do what he tries to...
*/
if (!$GLOBALS['is_superuser'] && !$GLOBALS['is_grantuser']
&& !$GLOBALS['is_createuser']
) {
$response->addHTML(PMA_getHtmlForSubPageHeader('privileges', '', false));
$response->addHTML(
PMA\libraries\Message::error(__('No Privileges'))
->getDisplay()
);
exit;
}