if (isset($mysqlConf['lc-messages'])) {
    if ($mysqlConf['lc-messages'] == 'fr_FR' && $wampConf['language'] != 'french') {
        $mysqlConfNew['lc-messages'] = "en_US";
        $iniFileContents = @file_get_contents($c_mysqlConfFile);
        foreach ($mysqlConfNew as $param => $value) {
            $iniFileContents = preg_replace('|^' . $param . '=.*|m', $param . '=' . $value, $iniFileContents);
        }
        $fp = fopen($c_mysqlConfFile, 'w');
        fwrite($fp, $iniFileContents);
        fclose($fp);
    }
}
//date.timezone and intl.default_locale (php.ini and phpForApache.ini)
$file_to_check = array($c_phpVersionDir . "/php" . $wampConf['phpVersion'] . "/" . $wampConf['phpConfFile'], $c_phpVersionDir . "/php" . $wampConf['phpVersion'] . "/" . $phpConfFileForApache);
foreach ($file_to_check as $c_phpConfFile) {
    $temp_file = file_get_contents_dos($c_phpConfFile);
    unset($phpConfNew, $temp_file);
    $phpConf = @parse_ini_file($c_phpConfFile);
    if (isset($phpConf['date.timezone']) && $phpConf['date.timezone'] == 'Europe/Paris' && $wampConf['language'] != 'french') {
        $phpConfNew['date.timezone'] = "UTC";
    }
    if (isset($phpConf['intl.default_locale']) && $phpConf['intl.default_locale'] == 'fr_FR' && $wampConf['language'] != 'french') {
        $phpConfNew['intl.default_locale'] = "en_US";
    }
    if (isset($phpConfNew)) {
        $iniFileContents = @file_get_contents($c_phpConfFile);
        foreach ($phpConfNew as $param => $value) {
            $iniFileContents = preg_replace('|^' . $param . ' = .*|m', $param . ' = ' . $value, $iniFileContents);
        }
        $fp = fopen($c_phpConfFile, 'w');
        fwrite($fp, $iniFileContents);
Exemple #2
0
<?php

//Update 3.0.1
//Replace $c_phpExe by $c_phpCli in call onlineOffline.php - Switch Apache Version
//Check if section [wampmysqld] in my.ini is the name of mysql service
//Check service names in mysql and apache wampserver.conf files
//Support for Windows 10 and Edge
require 'config.inc.php';
require 'wampserver.lib.php';
//Verify some files before generate wampmanager.ini file
//Check some files are DOS line ending
file_get_contents_dos($templateFile, false);
file_get_contents_dos($c_apacheConfFile, false);
file_get_contents_dos($c_apacheVhostConfFile, false);
// Insert do not EDIT to wamp/bin/php/phpx.y.z/php.ini file
$do_not_edit = <<<NOTEDITEOF
[PHP]
; **************************************************************
; ****** DO NOT EDIT THIS FILE **** DO NOT EDIT THIS FILE ******
; * This file is only use by PHP CLI (Command Line Interface)  *
; * that is to say by Wampserver internal PHP scripts          *
; * THE CORRECT FILE TO EDIT is Wampmanager Icon->PHP->php.ini *
; * that is wamp/bin/apache/apache2.x.y/bin/php.ini            *
; **************************************************************

NOTEDITEOF;
$iniFileContents = @file_get_contents($c_phpVersionDir . "/php" . $wampConf['phpVersion'] . "/" . $wampConf['phpConfFile']);
if (strpos($iniFileContents, "* DO NOT EDIT THIS FILE *") === false) {
    $iniFileContents = str_replace("[PHP]", $do_not_edit, $iniFileContents);
    $fp = fopen($c_phpVersionDir . "/php" . $wampConf['phpVersion'] . "/" . $wampConf['phpConfFile'], 'w');
    fwrite($fp, $iniFileContents);