configuration pour envolemigration
This commit is contained in:
@ -38,3 +38,10 @@ pwd_files:
|
||||
end_pattern: '',
|
||||
owner: 'root:www-data',
|
||||
mod: '660' }
|
||||
%if %%is_defined('activer_envole_migration') and %%activer_envole_migration == 'oui'
|
||||
- {file: '%%cnt_prefix/var/www/html/envole-migration/config/config-db-ninegate.php',
|
||||
pattern: '$dbpwd_ninegate = "',
|
||||
end_pattern: ';',
|
||||
owner: 'root:www-data',
|
||||
mod: '660' }
|
||||
%end if
|
||||
|
34
tmpl/ninegate-migration.php
Normal file
34
tmpl/ninegate-migration.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
try
|
||||
{
|
||||
global $bdd_ninegate;
|
||||
|
||||
%if %%getVar("ninegate_db_mode", 'non') == "externe"
|
||||
$dbhost_ninegate = "%%ninegate_dbserver";
|
||||
%else if %%getVar("ninegate_db_mode", 'non') == "default"
|
||||
%set dbhost = %%getVar('edb_host', 'non')
|
||||
%if %%dbhost == 'non' and %%mode_conteneur_actif == 'oui':
|
||||
$dbhost_ninegate = "%%adresse_ip_mysql";
|
||||
%else
|
||||
%if %%dbhost == 'non'
|
||||
$dbhost_ninegate = "localhost";
|
||||
%else
|
||||
$dbhost_ninegate = "%%edb_host";
|
||||
%end if
|
||||
%end if
|
||||
%else
|
||||
$dbhost_ninegate = "%%adresse_ip_mysql";
|
||||
%end if
|
||||
$dbname_ninegate = "ninegate";
|
||||
$dbuser_ninegate = "ninegate";
|
||||
$dbpwd_ninegate = "changeme";
|
||||
|
||||
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
|
||||
$pdo_options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES utf8";
|
||||
|
||||
$bdd_ninegate = new PDO('mysql:host='.$dbhost_ninegate.';dbname='.$dbname_ninegate.'',$dbuser_ninegate,$dbpwd_ninegate, $pdo_options);
|
||||
}
|
||||
catch (PDOException $e)
|
||||
{
|
||||
die('Erreur sur BDD ninegate : ' . $e->getMessage());
|
||||
}
|
Reference in New Issue
Block a user