本文整理汇总了PHP中ConfigFile::setPersistKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigFile::setPersistKeys方法的具体用法?PHP ConfigFile::setPersistKeys怎么用?PHP ConfigFile::setPersistKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::setPersistKeys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetConfigArray
/**
* Test for ConfigFile::getConfigArray
*
* @return void
* @test
*/
public function testGetConfigArray()
{
$this->object->setPersistKeys(array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE));
$this->object->set('Array/test', array('x', 'y'));
$default_value = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE);
$this->assertEquals(array(self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $default_value, 'Array/test' => array('x', 'y')), $this->object->getConfigArray());
}
示例2: testGetConfigFile
/**
* Test for ConfigGenerator::getConfigFile
*
* @return void
* @group medium
*/
public function testGetConfigFile()
{
$GLOBALS['cfg']['AvailableCharsets'] = array();
unset($_SESSION['eol']);
$GLOBALS['PMA_Config'] = new PMA_Config();
$GLOBALS['server'] = 0;
$cf = new ConfigFile();
$_SESSION['ConfigFile0'] = array('a', 'b', 'c');
$_SESSION['ConfigFile0']['Servers'] = array(array(1, 2, 3));
$cf->setPersistKeys(array("1/", 2));
$date = date(DATE_RFC1123);
$result = ConfigGenerator::getConfigFile($cf);
$this->assertContains("<?php\n" . "/*\n" . " * Generated configuration file\n" . " * Generated by: phpMyAdmin " . $GLOBALS['PMA_Config']->get('PMA_VERSION') . " setup script\n" . " * Date: " . $date . "\n" . " */\n\n", $result);
$this->assertContains("/* Servers configuration */\n" . '$i = 0;' . "\n\n" . "/* Server: localhost [0] */\n" . '$i++;' . "\n" . '$cfg[\'Servers\'][$i][\'0\'] = 1;' . "\n" . '$cfg[\'Servers\'][$i][\'1\'] = 2;' . "\n" . '$cfg[\'Servers\'][$i][\'2\'] = 3;' . "\n\n" . "/* End of servers configuration */\n\n", $result);
$this->assertContains('?>', $result);
}