function test_parse() { $str = "one = two\nthree = four"; $this->assertEquals(array('one' => 'two', 'three' => 'four'), Ini::parse($str)); $str = "[Section]\none = two\nthree = four"; $this->assertEquals(array('Section' => array('one' => 'two', 'three' => 'four')), Ini::parse($str, true)); }
public static function init($locale, $environment, $version) { $envFilename = Registry::get('applicationPath') . '/.env'; if (file_exists($envFilename)) { $env = Ini::parse($envFilename, true, $locale . '-' . $environment . '-' . $version, 'common', false); $env = self::mergeEnvVariables($env); } else { $env = new \StdClass(); } self::$data = Ini::bindArrayToObject($env); }
public static function init($locale, $environment, $version) { self::$data = new \StdClass(); $config = Ini::parse(Registry::get('applicationPath') . '/configs/config.ini', true, $locale . '-' . $environment . '-' . $version, 'common', true); self::$data = $config; }
<?php require_once 'packages/sys/Ini.class.php'; $ini = new Ini('editplus.ini'); $ini->parse(); echo "<pre>"; print_r($ini->get()); echo "</pre>";
/** * Fills the $tables property with a list of the directories * in inc/conf/quicklinks.xml. * * @access public * */ function getDirs() { global $loader; $loader->import('saf.Misc.Ini'); $links = Ini::parse('inc/conf/quicklinks.php'); foreach ($links as $name => $link) { if ($name != 'all') { $this->tables[$name] = $link->display; } } }