소스 검색

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

Nermosis 3 년 전
부모
커밋
1470f530e2
3개의 변경된 파일23개의 추가작업 그리고 38개의 파일을 삭제
  1. 1 0
      .gitignore
  2. 22 17
      application/controllers/Parser.php
  3. 0 21
      license.txt

+ 1 - 0
.gitignore 파일 보기

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

+ 22 - 17
application/controllers/Parser.php 파일 보기

68
     }
68
     }
69
 
69
 
70
     private function downloadProcess($urlXML)
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
         $fileName = basename($urlXML);
93
         $fileName = basename($urlXML);
73
         $downladedZip = $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
94
         $downladedZip = $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
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
     private function getFile($url, $fileName)
113
     private function getFile($url, $fileName)
143
             $attrHref = $row['@attributes']['href'];
148
             $attrHref = $row['@attributes']['href'];
144
 
149
 
145
             if ($attrNext === "next") {
150
             if ($attrNext === "next") {
146
-                if (!strpos($attrHref, "20220209_180023")) { //"20220127_")) {
151
+                if (!strpos($attrHref, "licitacionesPerfilesContratanteCompleto3_2021")) { //"20220127_")) {
147
                     $enlace = $attrHref;
152
                     $enlace = $attrHref;
148
                 } else {
153
                 } else {
149
                     $enlace = "";
154
                     $enlace = "";

+ 0 - 21
license.txt 파일 보기

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.