Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorAlexL
    • CommentTimeAug 4th 2007 edited
     # 1
    1. [code] [/code] or something similar would be really nice ;)

    2. Fixes:

    Line 63 and 122 replace:
    $CommentPosition = strpos($CurrentLine, '";');with:
    $CommentPosition = strpos($CurrentLine, '\';');

    Lines 65, 66, 124, 125 replace:
    $CommentPosition+6with:
    $CommentPosition+2

    Line 77 replace:
    ."'; "with:
    ."';"
    because we don't need a space char added every time the file is being saved

    Now we can actually use comments in setting-files like:
    $Configuration['String_Gallery'] = 'Hu'; // lalala


    I also suggest adding to line 96:

    } else {
    $Lines[] = "\$Configuration['"
    .$Name."'] = '"
    .$this->EncodeSettingValueForSaving($this->_settings[$Name])
    ."';\n";
    }


    So that parts looks like:

    // Now add the remaining settings in the _settings array that are different from the existing Settings
    while (list($Name, $Value) = each($this->_settings)) {
    if (array_key_exists($Name, $this->Settings)) {
    if ($this->Settings[$Name] != $Value) {
    $Lines[] = "\$Configuration['"
    .$Name."'] = '"
    .$this->EncodeSettingValueForSaving($this->_settings[$Name])
    ."';\n";
    }
    } else {
    $Lines[] = "\$Configuration['"
    .$Name."'] = '"
    .$this->EncodeSettingValueForSaving($this->_settings[$Name])
    ."';\n";
    }
    }
    $Lines[] = '?>';

    Be carefull to put the else after the "outer if"


    Alex
    • CommentAuthorithcy
    • CommentTimeAug 4th 2007
     # 2
    <code></code>
    • CommentAuthorAlexL
    • CommentTimeAug 4th 2007
     # 3
    Thanks
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 6th 2007
     # 4
    Great, and what do all these fixes do? :D
    • CommentAuthorAlexL
    • CommentTimeAug 6th 2007
     # 5
    First half is so that one can actually use comments in setting-files like:
    $Configuration['String_Gallery'] = 'Hu'; // lalala
    This is already implemented, but with a few bugs


    The last bit I can explain with a small example.

    without fix:

    settings.php is empty
    you save "vanilla" = "nice" into it and nothing happens!

    settings.php contains "vanilla" = "bad"
    you save "vanilla" = "nice" into it, everything is ok


    with fix:

    settings.php is empty
    you save "vanilla" = "nice" into it, everything is ok
Add your comments
    Username Password
  • Format comments as