コード例 #1
0
ファイル: ci_principal.php プロジェクト: emma5021/toba
 function get_schema_extension($fuente = null)
 {
     if (is_null($fuente) || !is_array($fuente)) {
         throw new toba_error_modelo('No se proporciono un ID válido para la fuente de datos', 'Se intenta obtener los esquemas configurados para una fuente inexistente');
     }
     $datos = toba_info_editores::get_schemas_fuente($fuente['fuente_datos_proyecto'], $fuente['fuente_datos']);
     if (empty($datos)) {
         $datos = array(array('schema' => 'public'));
     }
     return $datos;
 }
コード例 #2
0
ファイル: ci_dimensiones.php プロジェクト: emma5021/toba
 /**
  *	Lista de tablas que pueden usarse como gatillos
  *		No puede utilizarse dos veces la misma tabla como gatillo, por eso las utilizadas se excluyen
  */
 function get_tablas_gatillos()
 {
     $temp = $this->dependencia('datos')->tabla('dimension')->get();
     $datos = toba_info_editores::get_schemas_fuente(toba_editor::get_proyecto_cargado(), $temp['fuente_datos']);
     $schemas = !empty($datos) ? aplanar_matriz($datos, 'schema') : null;
     $tablas = toba::db($temp['fuente_datos'], toba_editor::get_proyecto_cargado())->get_lista_tablas(true, $schemas);
     return $tablas;
 }
コード例 #3
0
 function purgar_auditoria($tiempo = 0, $tablas = array(), $prefijo_tablas = null, $con_transaccion = true)
 {
     $this->manejador_interface->mensaje('Limpiando las tablas de auditoria', true);
     $fuentes = $this->proyecto->get_indice_fuentes();
     toba_logger::instancia()->var_dump($fuentes, 'fuentes activas');
     if (empty($fuentes)) {
         return;
     }
     $schemas = array();
     foreach ($fuentes as $fuente) {
         $schemas[$fuente] = aplanar_matriz(toba_info_editores::get_schemas_fuente($this->proyecto->get_id(), $fuente), 'schema');
     }
     toba_logger::instancia()->var_dump($schemas, 'schemas de fuentes');
     foreach ($fuentes as $fuente) {
         try {
             $base = $this->proyecto->get_db_negocio($fuente);
             $this->procesar_schemas_fuente($base, $schemas[$fuente], $con_transaccion, $tablas, $prefijo_tablas, 'purgar', $tiempo);
             unset($base);
         } catch (toba_error_db $e) {
             if (isset($base)) {
                 $base->abortar_transaccion();
                 //Si hay algun error hace revert y anula el objeto de la bd
                 unset($base);
             }
         }
     }
 }