本文整理汇总了PHP中JRegistry::loadIni方法的典型用法代码示例。如果您正苦于以下问题:PHP JRegistry::loadIni方法的具体用法?PHP JRegistry::loadIni怎么用?PHP JRegistry::loadIni使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRegistry
的用法示例。
在下文中一共展示了JRegistry::loadIni方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load()
{
$params = JComponentHelper::getComponent('com_files')->params;
$registry = new JRegistry();
$registry->loadIni($params);
$this->setData($registry->toArray());
return $this;
}
示例2: paramsToObject
private static function paramsToObject($data)
{
$registry = new JRegistry();
$registry->loadIni($data);
return $registry->toObject();
}
示例3: testLoadINI
/**
* Test the JRegistry::loadIni method.
*/
public function testLoadINI()
{
//$string = "[section]\nfoo=\"testloadini\"";
$registry = new JRegistry();
$result = $registry->loadIni("foo=\"testloadini1\"");
// Result is always true, no error checking in method.
// Test getting a known value.
$this->assertThat($registry->get('foo'), $this->equalTo('testloadini1'), 'Line: ' . __LINE__ . '.');
$result = $registry->loadIni("[section]\nfoo=\"testloadini2\"");
// Test getting a known value.
$this->assertThat($registry->get('foo'), $this->equalTo('testloadini2'), 'Line: ' . __LINE__ . '.');
$result = $registry->loadIni("[section]\nfoo=\"testloadini3\"", null, true);
// Test getting a known value after processing sections.
$this->assertThat($registry->get('section.foo'), $this->equalTo('testloadini3'), 'Line: ' . __LINE__ . '.');
}