ldo...@users.adullact.net
unread,10:44 AM (7 hours ago) 10:44 AMSign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openmairie...@googlegroups.com
Author: ldorner
Date: 2026-03-05 16:44:49 +0100 (Thu, 05 Mar 2026)
New Revision: 5512
Modified:
openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php
Log:
fix: fallback plus radical pour gestion des booleens
Modified: openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php
===================================================================
--- openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php 2026-03-05 14:48:39 UTC (rev 5511)
+++ openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php 2026-03-05 15:44:49 UTC (rev 5512)
@@ -455,67 +455,14 @@
* Récupère les métadonnées des colonnes d'une table avec mise en cache.
* Retourne un tableau associatif [column_name => ['type' => 'int4', ...]]
*
- * Cette méthode utilise en priorité les métadonnées du fichier généré
- * all_tables.inc.php, et se rabat sur une requête à la base de données
- * si la table n'est pas trouvée dans le fichier.
- *
* @param string $table Nom de la table
* @return array Tableau associatif des métadonnées des colonnes
*/
- protected function get_table_columns_metadata_pdo($table) {
- // Vérifier le cache
- /*if (isset($this->table_metadata_cache[$table])) {
- return $this->table_metadata_cache[$table];
- }*/
-
+ protected function get_table_columns_metadata_pdo($table) {
//LDO cas table non trouvée
$class_name = $this->resolve_class_name_from_table($table);
return $class_name::get_columns_metadata();
-
-/*LDO
- // Essayer d'abord de récupérer les métadonnées depuis le fichier généré
- $generated_metadata = $this->get_table_columns_metadata_from_generated_file($table);
- if ($generated_metadata !== null) {
- // Transformer en format attendu (compatible avec l'ancien format)
- $columns_metadata = array();
- foreach ($generated_metadata as $col_name => $col_info) {
- $columns_metadata[$col_name] = array(
- 'type' => isset($col_info['type']) ? $col_info['type'] : '',
- 'len' => isset($col_info['len']) ? $col_info['len'] : -1,
- 'flags' => isset($col_info['flags']) ? $col_info['flags'] : ''
- );
- }
-
- // Mettre en cache
- $this->table_metadata_cache[$table] = $columns_metadata;
-
- $this->addToLog(
- __METHOD__."(): Métadonnées de la table '".$table."' récupérées depuis le fichier généré",
- VERBOSE_MODE
- );
-
- return $columns_metadata;
- }
-
- // Sinon, récupérer les informations de la table depuis la base de données
- $table_info = $this->get_db_table_info_pdo($table);
-
- // Construire le tableau associatif column_name => metadata
- $columns_metadata = array();
- foreach ($table_info as $col_info) {
- $columns_metadata[$col_info['name']] = array(
- 'type' => $col_info['type'],
- 'len' => $col_info['len'],
- 'flags' => $col_info['flags']
- );
- }
-
- // Mettre en cache
- $this->table_metadata_cache[$table] = $columns_metadata;
-
- return $columns_metadata;
- */
}
/**
@@ -1521,13 +1468,17 @@
} else {
// Fallback : getColumnMeta() pour les colonnes
// non trouvées dans les métadonnées des classes
- $meta = $stmt->getColumnMeta($i);
+ /*$meta = $stmt->getColumnMeta($i);
$column_name = strtolower($meta['name']);
$native_type = isset($meta['native_type']) ? $meta['native_type'] : '';
if ($native_type === 'bool') {
$boolean_columns[$column_name] = true;
$boolean_columns[$i] = true;
- }
+ }*/
+ $this->addToLog(
+ $origin."(): COLUMN NOT FOUND - SKIPPED AS NON BOOL : ".$lower_key_check,
+ VERBOSE_MODE
+ );
}
}
$i++;