This commit updates the `fxStaticSyncClientDatabaseConfigs` function to return detailed database connection configurations for both preprod and prod clients. It introduces a new class, `clsMysqlStaticSync`, to manage MySQL connections with a short timeout, improving connection handling. The `fxStaticSyncConnect` function is refined to utilize this new class, and the synchronization UI is updated to reflect the new client configurations. These changes streamline database interactions and enhance the overall synchronization process.
182 lines
6.1 KiB
PHP
182 lines
6.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Config outil sync_static_db.php — NE PAS mettre dans inc_settings.php (fichier prod critique).
|
|
*
|
|
* Connexions BD client : mêmes user/pass/db que le bloc ms1inscription.com dans inc_settings.php,
|
|
* avec host distant pour accès depuis le serveur dev. Mettre à jour ici si prod change.
|
|
*/
|
|
|
|
/**
|
|
* BD client — mêmes paramètres que le bloc ms1inscription.com dans inc_settings.php.
|
|
* host = localhost (tunnel VPN / MySQL local), pas d'IP distante.
|
|
*/
|
|
function fxStaticSyncClientDatabaseConfigs() {
|
|
return array(
|
|
'client_preprod' => array(
|
|
'label' => 'Client préprod',
|
|
'host' => 'localhost',
|
|
'user' => 'ms1incription_bd',
|
|
'pass' => '3+~=,y=eV)M;',
|
|
'db' => 'ms1incription_preprod',
|
|
),
|
|
'client_prod' => array(
|
|
'label' => 'Client prod',
|
|
'host' => 'localhost',
|
|
'user' => 'ms1incription_bd',
|
|
'pass' => '3+~=,y=eV)M;',
|
|
'db' => 'ms1incription_prod',
|
|
),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Tables statiques / programmation — source de vérité : devinscription_preprod.
|
|
* Ajouter ici toute nouvelle table de référence à synchroniser.
|
|
*
|
|
* keys : clé métier (identifiant logique de la ligne)
|
|
* ignore_cols : colonnes exclues du hash de contenu (PK auto, timestamps)
|
|
*/
|
|
function fxStaticSyncTableDefinitions() {
|
|
return array(
|
|
array(
|
|
'table' => 'info',
|
|
'label' => 'Textes UI (info)',
|
|
'keys' => array('info_clef', 'info_langue', 'info_prg'),
|
|
'ignore_cols' => array('pk_info', 'info_creation', 'info_maj'),
|
|
),
|
|
array(
|
|
'table' => 'doc_mod',
|
|
'label' => 'Documentation — modules',
|
|
'keys' => array('doc_mod_clef', 'doc_mod_prg'),
|
|
'ignore_cols' => array('pk_doc_mod', 'doc_mod_creation', 'doc_mod_maj'),
|
|
),
|
|
array(
|
|
'table' => 'doc_page',
|
|
'label' => 'Documentation — pages',
|
|
'keys' => array('doc_page_clef', 'doc_langue', 'doc_prg'),
|
|
'ignore_cols' => array('pk_doc_page', 'doc_creation', 'doc_maj'),
|
|
),
|
|
array(
|
|
'table' => 'doc_anchor',
|
|
'label' => 'Documentation — ancres',
|
|
'keys' => array('doc_anchor_clef', 'doc_prg'),
|
|
'ignore_cols' => array('pk_doc_anchor', 'doc_creation'),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_eve_permissions',
|
|
'label' => 'Accès v2 — permissions',
|
|
'keys' => array('perm_key'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_eve_roles',
|
|
'label' => 'Accès v2 — rôles',
|
|
'keys' => array('role_code'),
|
|
'ignore_cols' => array('role_id', 'role_created_at', 'role_updated_at'),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_eve_role_permissions',
|
|
'label' => 'Accès v2 — matrice rôles',
|
|
'keys' => array('role_id', 'perm_key'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_pages',
|
|
'label' => 'Pages promoteur',
|
|
'keys' => array('pag_code'),
|
|
'ignore_cols' => array('pag_id', 'pag_maj'),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_taux',
|
|
'label' => 'Taxes — taux',
|
|
'keys' => array('tau_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_taux_types',
|
|
'label' => 'Taxes — types',
|
|
'keys' => array('tt_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_taux_types_taux',
|
|
'label' => 'Taxes — types/taux',
|
|
'keys' => array('ttt_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_frais',
|
|
'label' => 'Frais — catalogue',
|
|
'keys' => array('fra_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'inscriptions_evenements_frais',
|
|
'label' => 'Frais — événements',
|
|
'keys' => array('efr_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'modes_remboursements',
|
|
'label' => 'Modes remboursement',
|
|
'keys' => array('mod_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'types_remboursements',
|
|
'label' => 'Types remboursement',
|
|
'keys' => array('typ_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'adm_menus',
|
|
'label' => 'ADM — menus',
|
|
'keys' => array('men_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'adm_forms',
|
|
'label' => 'ADM — formulaires',
|
|
'keys' => array('for_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'adm_labels',
|
|
'label' => 'ADM — labels',
|
|
'keys' => array('lab_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'adm_messages',
|
|
'label' => 'ADM — messages',
|
|
'keys' => array('mes_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'config_query',
|
|
'label' => 'Config — requêtes',
|
|
'keys' => array('query_clef'),
|
|
'ignore_cols' => array('pk_query'),
|
|
),
|
|
array(
|
|
'table' => 'config_tableau',
|
|
'label' => 'Config — tableaux',
|
|
'keys' => array('clef'),
|
|
'ignore_cols' => array('id'),
|
|
),
|
|
array(
|
|
'table' => 'regles_niveau',
|
|
'label' => 'Règles niveau',
|
|
'keys' => array('reg_id'),
|
|
'ignore_cols' => array(),
|
|
),
|
|
array(
|
|
'table' => 'variables',
|
|
'label' => 'Variables système',
|
|
'keys' => array('var_nom'),
|
|
'ignore_cols' => array('var_id'),
|
|
),
|
|
);
|
|
}
|