示例#1
0
    public function testMultilineValues()
    {
        $config = <<<'EOD'
[section]
key1 = "with some
newline in the value"
EOD;
        $doc = IniParser::parseIni($config);
        $this->assertEquals(2, count(explode("\n", $doc->getSection('section')->getDirective('key1')->getValue())), 'IniParser does not recognize multi-line values');
    }
示例#2
0
 /**
  * Render the Zend_Config into a config filestring
  *
  * @return  string
  */
 public function render()
 {
     if (file_exists($this->filename)) {
         $oldconfig = Config::fromIni($this->filename);
         $content = trim(file_get_contents($this->filename));
     } else {
         $oldconfig = Config::fromArray(array());
         $content = '';
     }
     $doc = IniParser::parseIni($content);
     $this->diffPropertyUpdates($this->config, $doc);
     $this->diffPropertyDeletions($oldconfig, $this->config, $doc);
     $doc = $this->updateSectionOrder($this->config, $doc);
     return $doc->render();
 }