function copyOverSettings($icvInfo) { global $updateDone; // System settings echo 'Transposing system settings...<br>'; transposeSettings(PATH . "lib/config___settings.php", "config___settings.php", "config___settings.php"); // Users template settings echo 'Transposing users template settings...<br>'; transposeSettings(PATH . "lib/config___users-template.php", "config___users-template.php", "config___users-template.php"); // Users settings files $fileList = scanDir(PATH . "lib/"); for ($i = 0; $i < count($fileList); $i++) { if (strpos($fileList[$i], "config-") > -1) { echo 'Transposing users settings file ' . $fileList[$i] . '...<br>'; transposeSettings(PATH . "lib/" . $fileList[$i], "config___users-template.php", $fileList[$i]); } } echo 'All update tasks completed...<br>'; $updateDone = true; }
function copyOverSettings($icvInfo) { global $updateDone, $configSettings; // System settings echo 'Transposing system settings...<br>'; // Create a new config file if it doesn't exist yet. // The reason we create it, is so it has PHP write permissions, meaning we can update it later if (!file_exists(dirname(__FILE__) . "/" . $configSettings)) { echo 'Creating new settings file...<br>'; // Include our params to make use of (as $newConfigSettingsFile) include dirname(__FILE__) . "/settings-system-params.php"; if ($fConfigSettings = fopen(dirname(__FILE__) . "/" . $configSettings, 'w')) { fwrite($fConfigSettings, $newConfigSettingsFile); fclose($fConfigSettings); } else { die("Cannot update config file lib/" . $configSettings . ". Please check write permissions on lib/ and try again"); } } transposeSettings(PATH . "lib/config___settings.php", "config___settings.php", "config___settings.php"); // Users template settings echo 'Transposing users template settings...<br>'; transposeSettings(PATH . "lib/config___users-template.php", "config___users-template.php", "config___users-template.php"); // Users settings files $fileList = scanDir(PATH . "lib/"); for ($i = 0; $i < count($fileList); $i++) { if (strpos($fileList[$i], "config-") > -1) { echo 'Transposing users settings file ' . $fileList[$i] . '...<br>'; transposeSettings(PATH . "lib/" . $fileList[$i], "config___users-template.php", $fileList[$i]); } } echo 'All update tasks completed...<br>'; $updateDone = true; }