Beispiel #1
0
 /**
  * @dataProvider getTestDataForDumpSortTest
  */
 public function test_dumpChanges_CorrectlySortsSections_ByWhenTheyAppearInConfigFiles($defaultSettingsFiles, $userSettingsFile, $changesToApply, $header, $expectedDumpChanges)
 {
     $fileChain = new IniFileChain($defaultSettingsFiles, $userSettingsFile);
     foreach ($changesToApply as $sectionName => $section) {
         $fileChain->set($sectionName, $section);
     }
     $actualOutput = $fileChain->dumpChanges($header);
     $this->assertEquals($expectedDumpChanges, $actualOutput);
 }
Beispiel #2
0
 public function __construct($settingsChain, $mergedSettings)
 {
     parent::__construct();
     $this->settingsChain = $settingsChain;
     $this->mergedSettings = $mergedSettings;
 }
Beispiel #3
0
 /**
  * Dump config
  *
  * @return string|null
  * @throws \Exception
  */
 public function dumpConfig()
 {
     $header = "; <?php exit; ?> DO NOT REMOVE THIS LINE\n";
     $header .= "; file automatically generated or modified by Piwik; you can manually override the default values in global.ini.php by redefining them in this file.\n";
     return $this->settings->dumpChanges($header);
 }