Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also propagate the comments #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 18, 2017

  1. Also propagate the comments

    Adding the possibility to also propagate the comments when writing the ini file. Works as follows:
    
    $ini = 'piwik.ini';
    $reader = new \Piwik\Ini\IniReader();
    $config = $reader->readFile($ini);
    $comments = $reader->readComments($ini);
    $writer = new \Piwik\Ini\IniWriter();
    $writer->writeToFile('piwik-new.ini', $config, '', $comments);
    
    Things that do not work:
    
    1 pre-section comments disappear:
      ; section comment
      [MySection]
      ; option comment
      myOption = 1
    
    becomes
      [MySection]
      ; option comment
      myOption = 1
    
    2 Individual array comments disappear:
      [MySection]
      ; comment a
      ar[] = "a"
      ; comment b
      ar[] = "b"
      ; comment c
      ar[] = "c"
    
    becomes
      [MySection]
      ; comment a
      ar[] = "a"
      ar[] = "b"
      ar[] = "c"
    tetrode committed Jan 18, 2017
    Configuration menu
    Copy the full SHA
    a37cd9f View commit details
    Browse the repository at this point in the history