本文整理匯總了PHP中ConfigFile::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigFile::get方法的具體用法?PHP ConfigFile::get怎麽用?PHP ConfigFile::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetServerCount
/**
* Test for ConfigFile::getServerCount
*
* @return void
* @test
*/
public function testGetServerCount()
{
$this->object->set('Servers/1/x', 1);
$this->object->set('Servers/2/x', 2);
$this->object->set('Servers/3/x', 3);
$this->object->set('Servers/4/x', 4);
$this->object->set('ServerDefault', 3);
$this->assertEquals(
4,
$this->object->getServerCount()
);
$this->object->removeServer(2);
$this->object->removeServer(2);
$this->assertEquals(
2,
$this->object->getServerCount()
);
$this->assertLessThanOrEqual(
2,
$this->object->get('ServerDefault')
);
$this->assertEquals(
array('Servers' => array(1 => array('x' => 1), 2 => array('x' => 4))),
$this->object->getConfig()
);
$this->assertEquals(
array('Servers/1/x' => 1, 'Servers/2/x' => 4),
$this->object->getConfigArray()
);
}
示例2: _loadUserprefsInfo
/**
* Fills out {@link userprefs_keys} and {@link userprefs_disallow}
*
* @return void
*/
private function _loadUserprefsInfo()
{
if ($this->_userprefsKeys === null) {
$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);
}
}