本文整理汇总了PHP中PMA_readUserprefsFieldNames函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_readUserprefsFieldNames函数的具体用法?PHP PMA_readUserprefsFieldNames怎么用?PHP PMA_readUserprefsFieldNames使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_readUserprefsFieldNames函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_applyUserprefs
/**
* Returns a user preferences array filtered by $cfg['UserprefsDisallow']
* (blacklist) and keys from user preferences form (whitelist)
*
* @param array $config_data path => value pairs
*
* @return array
*/
function PMA_applyUserprefs(array $config_data)
{
$cfg = array();
$blacklist = array_flip($GLOBALS['cfg']['UserprefsDisallow']);
if (!$GLOBALS['cfg']['UserprefsDeveloperTab']) {
// disallow everything in the Developers tab
$blacklist['DBG/sql'] = true;
}
$whitelist = array_flip(PMA_readUserprefsFieldNames());
// whitelist some additional fields which are custom handled
$whitelist['ThemeDefault'] = true;
$whitelist['fontsize'] = true;
$whitelist['lang'] = true;
$whitelist['collation_connection'] = true;
$whitelist['Server/hide_db'] = true;
$whitelist['Server/only_db'] = true;
foreach ($config_data as $path => $value) {
if (!isset($whitelist[$path]) || isset($blacklist[$path])) {
continue;
}
PMA_arrayWrite($path, $cfg, $value);
}
return $cfg;
}
示例2: _loadUserprefsInfo
/**
* Fills out {@link userprefs_keys} and {@link userprefs_disallow}
*
* @return void
*/
private function _loadUserprefsInfo()
{
if ($this->_userprefsKeys !== null) {
return;
}
$this->_userprefsKeys = array_flip(PMA_readUserprefsFieldNames());
// read real config for user preferences display
$userprefs_disallow = defined('PMA_SETUP') ? $this->_configFile->get('UserprefsDisallow', array()) : $GLOBALS['cfg']['UserprefsDisallow'];
$this->_userprefsDisallow = array_flip($userprefs_disallow);
}
示例3: testReadUserprefsFieldNames
/**
* Test for PMA_readUserprefsFieldNames
*
* @return void
*/
public function testReadUserprefsFieldNames()
{
$this->assertGreaterThan(0, count(PMA_readUserprefsFieldNames()));
$forms = array('form1' => array(array('Servers/1/hide_db', 'bar'), array('test' => 'val')));
$this->assertEquals(array('Servers/1/hide_db', 'bar', 'test'), PMA_readUserprefsFieldNames($forms));
}