Kaynağa Gözat

Parametrizar descarga de Zips por mes. Habilitar descarga de archivos de modo diaria

Nermosis 3 yıl önce
ebeveyn
işleme
1470f530e2
3 değiştirilmiş dosya ile 23 ekleme ve 38 silme
  1. 1 0
      .gitignore
  2. 22 17
      application/controllers/Parser.php
  3. 0 21
      license.txt

+ 1 - 0
.gitignore Dosyayı Görüntüle

@@ -36,3 +36,4 @@ uploads/
36 36
 application/config/database.php
37 37
 application/libraries/ParserDatabaseBruto1.php
38 38
 .vscode/launch.json123
39
+myphp-backup-liciagbar-20220127_210105.sql.gz

+ 22 - 17
application/controllers/Parser.php Dosyayı Görüntüle

@@ -68,6 +68,27 @@ class Parser extends CI_Controller
68 68
     }
69 69
 
70 70
     private function downloadProcess($urlXML)
71
+    {
72
+
73
+        $fileName = basename($urlXML);
74
+        $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
75
+        $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
76
+        $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
77
+
78
+        while ($nuevoAtomAttrNext !== "") {
79
+            //$aux = 0;
80
+            //while ($aux <= 3) {
81
+
82
+            $fileName = basename($nuevoAtomAttrNext);
83
+            $this->downloadFile($fileName, $nuevoAtomAttrNext, $this->rutaDiariaFecha);
84
+            $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
85
+
86
+            $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
87
+            //$aux++;
88
+        }
89
+    }
90
+
91
+    private function downloadZip($urlXML)
71 92
     {
72 93
         $fileName = basename($urlXML);
73 94
         $downladedZip = $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
@@ -87,22 +108,6 @@ class Parser extends CI_Controller
87 108
             }
88 109
 
89 110
         }
90
-        /*$fileName = basename($urlXML);
91
-    $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
92
-    $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
93
-    $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
94
-
95
-    while ($nuevoAtomAttrNext !== "") {
96
-    //$aux = 0;
97
-    //while ($aux <= 3) {
98
-
99
-    $fileName = basename($nuevoAtomAttrNext);
100
-    $this->downloadFile($fileName, $nuevoAtomAttrNext, $this->rutaDiariaFecha);
101
-    $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
102
-
103
-    $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
104
-    //$aux++;
105
-    }*/
106 111
     }
107 112
 
108 113
     private function getFile($url, $fileName)
@@ -143,7 +148,7 @@ class Parser extends CI_Controller
143 148
             $attrHref = $row['@attributes']['href'];
144 149
 
145 150
             if ($attrNext === "next") {
146
-                if (!strpos($attrHref, "20220209_180023")) { //"20220127_")) {
151
+                if (!strpos($attrHref, "licitacionesPerfilesContratanteCompleto3_2021")) { //"20220127_")) {
147 152
                     $enlace = $attrHref;
148 153
                 } else {
149 154
                     $enlace = "";

+ 0 - 21
license.txt Dosyayı Görüntüle

@@ -1,21 +0,0 @@
1
-The MIT License (MIT)
2
-
3
-Copyright (c) 2014 - 2019, British Columbia Institute of Technology
4
-
5
-Permission is hereby granted, free of charge, to any person obtaining a copy
6
-of this software and associated documentation files (the "Software"), to deal
7
-in the Software without restriction, including without limitation the rights
8
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
-copies of the Software, and to permit persons to whom the Software is
10
-furnished to do so, subject to the following conditions:
11
-
12
-The above copyright notice and this permission notice shall be included in
13
-all copies or substantial portions of the Software.
14
-
15
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
-THE SOFTWARE.