Example #1
0
 function proyecto__copiar_punto_acceso()
 {
     $dir_destino = $this->elemento->get_dir() . '/www/';
     $destino_final = toba_manejador_archivos::path_a_plataforma($dir_destino . 'servicios.php');
     $origen = toba_dir() . '/php/modelo/template_proyecto/www/servicios.php';
     if (!toba_manejador_archivos::existe_archivo_en_path($destino_final)) {
         $template = file_get_contents($origen);
         //Leo el template original
         $editor = new toba_editor_texto();
         $editor->agregar_sustitucion('|__proyecto__|', $this->elemento->get_id());
         $salida = $editor->procesar($template);
         file_put_contents($destino_final, $salida, FILE_APPEND);
     }
 }
Example #2
0
 private function crear_tablas_log()
 {
     $this->manejador_interface->mensaje('Creando las tablas de log', false);
     $schema_logs = $this->get_schema_db() . '_logs';
     $sql = "CREATE SCHEMA {$schema_logs};";
     //Creo el schema ya que no existe
     $this->get_db()->ejecutar($sql);
     $this->get_db()->set_schema($schema_logs);
     $directorio = toba_modelo_nucleo::get_dir_ddl();
     $nombre = $directorio . '/' . self::ddl_archivo_tablas_log . '.sql';
     if (file_exists($nombre)) {
         //Aca tengo que hacer un cambio veneno
         $template = file_get_contents($nombre);
         $editor = new toba_editor_texto();
         $editor->agregar_sustitucion('|__toba_logs__|', $schema_logs);
         $sql = $editor->procesar($template);
         $cant = $this->get_db()->ejecutar($sql);
         toba_logger::instancia()->debug($nombre . ". ({$cant})");
         $this->manejador_interface->progreso_avanzar();
     }
 }
 /**
  * Agrega al archivo toba.conf la definicion del proyecto
  */
 static function agregar_alias_apache($alias, $dir, $instancia, $id_proyecto, $pers = false)
 {
     $archivo = self::get_archivo_alias_apache();
     //--- Se agrega el proyecto al archivo
     if ($pers) {
         $template = file_get_contents(toba_dir() . '/php/modelo/var/proyecto_pers.conf');
     } else {
         $template = file_get_contents(toba_dir() . '/php/modelo/var/proyecto.conf');
     }
     $editor = new toba_editor_texto();
     $editor->agregar_sustitucion('|__toba_dir__|', toba_manejador_archivos::path_a_unix(toba_dir()));
     $editor->agregar_sustitucion('|__proyecto_dir__|', toba_manejador_archivos::path_a_unix($dir));
     $editor->agregar_sustitucion('|__proyecto_alias__|', $alias);
     $editor->agregar_sustitucion('|__proyecto_id__|', $id_proyecto);
     $editor->agregar_sustitucion('|__instancia__|', $instancia);
     $editor->agregar_sustitucion('|__instalacion_dir__|', toba_manejador_archivos::path_a_unix(self::dir_base()));
     $salida = $editor->procesar($template);
     file_put_contents($archivo, $salida, FILE_APPEND);
 }