Fork me on GitHub

personal_config.php  Bottom

  • hello everybody,
    to test some new features and/or tricks on a test site, I usually duplicate the DB and zikula files, but any time I have to modify the config.php file to point to the correct test database instead of the live site.

    Now, I noticed at the bottom of the config.php file this include, about a personal_config.php file

    Code

    // ----------------------------------------------------------------------
    // if there is a personal_config.php in the folder where is config.php
    // we add it. (This HAS to be at the end, after all initialization.)
    // ----------------------------------------------------------------------
    if (file_exists('config/personal_config.php')) {
        require_once 'config/personal_config.php';
    }


    So i think I could simply add that file in my test directory tree, with the override definitions (mainly dbname change), without any modification to the original backupped files from the live site, and I have a working test site... am I right?

    thank you in advance
    Enrico
  • True
    but i'm afraid that was a feature of 0.764
    Zikula doesn't have that option and you must put all the info in the config.php
    anyways, it's required, why to have it outside? icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • nestormateo

    True
    but i'm agraid that was a feature of 0.764
    Zikula doesn't have that option and you must put all the info in the config.php


    Well... I'm talking about a fresh Zikula 1.0.2 installation (waiting to be upgraded to 1.1.1), and the option is there, in the config.php...

    Quote


    anyways, it's required, why to have it outside? icon_wink


    That way, I could simply duplicate the live site files, and do not worry about modifying anything, as the new settings are in the personal config file, that I'd use only on the test site...

    thanks
    Enrico
  • if you do that, i think the DB parameter from your personnal_config will override the parameter from the current config.php file.

    Is that what you wan't ?
  • Uh, true!
    i've read somewhere about it deletion, but well, it's there in the 2.0 too
    cool point about test site icon_wink
    i haven't thought about it icon_razz

    Greetings Enrico!

    --
    - Mateo T. -
    Mis principios... son mis fines
  • mumuri

    if you do that, i think the DB parameter from your personnal_config will override the parameter from the current config.php file.

    Is that what you wan't ?


    yes indeed! icon_smile

    what comes in my mind now is if this mechanism could be a security risk.
    On a regular website, simply adding a maliciuos peronal_config.php file could pass all the modificaion checks based on config.php file size, or modification date...

    anyway, I think that if someone is able to write in the config directory, can make damages even without this subtle trick... icon_smile


    thank you everyone!
  • if you re parano, you can "touch" an empty personal_config and make it read only ^^

This list is based on users active over the last 60 minutes.