Ver código fonte

Parseador para zip, desde 2012 hasta 2020

Christian 3 anos atrás
pai
commit
083e69baa2
1 arquivos alterados com 24 adições e 24 exclusões
  1. 24 24
      application/controllers/Parser.php

+ 24 - 24
application/controllers/Parser.php Ver arquivo

25
 
25
 
26
     public function index()
26
     public function index()
27
     {
27
     {
28
-        /*$existCronRun = $this->Parser_model->existCronRun();
28
+        $existCronRun = $this->Parser_model->existCronRun();
29
 
29
 
30
         if ($existCronRun['num_rows'] > 0) {
30
         if ($existCronRun['num_rows'] > 0) {
31
-        if ($existCronRun['datos']->cron_ejecucion == 0) {
31
+            if ($existCronRun['datos']->cron_ejecucion == 0) {
32
 
32
 
33
-        $this->Parser_model->inicioParser();
33
+                $this->Parser_model->inicioParser();
34
 
34
 
35
-        $resultSetPerfiles = $this->Parser_model->getUrlArchivos();
35
+                $resultSetPerfiles = $this->Parser_model->getUrlArchivos();
36
 
36
 
37
-        foreach ($resultSetPerfiles['datos'] as $row) {
38
-        $fechaCarpeta = date("Y-m-d_H-i-s");
39
-        $this->fechaCreacionLog = $fechaCarpeta;
40
-        $rutaPerfil = $this->rutaDiaria . "/" . $row->prefijos_tablas;
37
+                foreach ($resultSetPerfiles['datos'] as $row) {
38
+                    $fechaCarpeta = date("Y-m-d_H-i-s");
39
+                    $this->fechaCreacionLog = $fechaCarpeta;
40
+                    $rutaPerfil = $this->rutaDiaria . "/" . $row->prefijos_tablas;
41
 
41
 
42
-        $this->newFolder($rutaPerfil);
42
+                    $this->newFolder($rutaPerfil);
43
 
43
 
44
-        if ($this->newFolder($rutaPerfil . "/" . $fechaCarpeta)) {
45
-        $this->rutaDiariaFecha = $rutaPerfil . "/" . $fechaCarpeta . "/";
44
+                    if ($this->newFolder($rutaPerfil . "/" . $fechaCarpeta)) {
45
+                        $this->rutaDiariaFecha = $rutaPerfil . "/" . $fechaCarpeta . "/";
46
 
46
 
47
-        $this->downloadProcess($row->url_descarga);
48
-        }
49
-        }
47
+                        $this->downloadProcess($row->url_descarga);
48
+                    }
49
+                }
50
 
50
 
51
-        $this->parserfile->index($this->rutaDiariaFecha, $fechaCarpeta, $row);
51
+                $this->parserfile->index($this->rutaDiariaFecha, $fechaCarpeta, $row);
52
 
52
 
53
+            } else {
54
+                echo "EXISTE UN CRON EN MARCHA.";
55
+            }
53
         } else {
56
         } else {
54
-        echo "EXISTE UN CRON EN MARCHA.";
55
-        }
56
-        } else {
57
-        echo "No existe parametro que iniciar.";
57
+            echo "No existe parametro que iniciar.";
58
         }
58
         }
59
 
59
 
60
         $this->Parser_model->stopParser();
60
         $this->Parser_model->stopParser();
61
 
61
 
62
-        $this->tablasCalculadas($this->fechaCreacionLog);*/
62
+        $this->tablasCalculadas($this->fechaCreacionLog);
63
 
63
 
64
-        $resultSetPerfiles = $this->Parser_model->getUrlArchivos();
65
-        foreach ($resultSetPerfiles['datos'] as $row) {
66
-            $this->parserfile->index($this->rutaDiaria . "PER_PCSP_EX/2022-02-17_20-38-16", date("Y-m-d"), $row);
67
-        }
64
+        /* $resultSetPerfiles = $this->Parser_model->getUrlArchivos();
65
+    foreach ($resultSetPerfiles['datos'] as $row) {
66
+    $this->parserfile->index($this->rutaDiaria . "PER_PCSP_EX/2022-02-17_20-38-16", date("Y-m-d"), $row);
67
+    } */
68
     }
68
     }
69
 
69
 
70
     private function downloadProcess($urlXML)
70
     private function downloadProcess($urlXML)