Ver Fonte

* Added HTTP downloader

git-svn-id: trunk@17481 -
michael há 14 anos atrás
pai
commit
2c7a4cb5c3
4 ficheiros alterados com 514 adições e 45 exclusões
  1. 1 0
      .gitattributes
  2. 467 32
      packages/fppkg/Makefile
  3. 13 13
      packages/fppkg/Makefile.fpc
  4. 33 0
      packages/fppkg/src/pkgfphttp.pp

+ 1 - 0
.gitattributes

@@ -2588,6 +2588,7 @@ packages/fppkg/src/fprepos.pp svneol=native#text/plain
 packages/fppkg/src/fpxmlrep.pp svneol=native#text/plain
 packages/fppkg/src/pkgcommands.pp svneol=native#text/plain
 packages/fppkg/src/pkgdownload.pp svneol=native#text/plain
+packages/fppkg/src/pkgfphttp.pp svneol=native#text/plain
 packages/fppkg/src/pkgfpmake.pp svneol=native#text/plain
 packages/fppkg/src/pkgglobals.pp svneol=native#text/plain
 packages/fppkg/src/pkghandler.pp svneol=native#text/plain

Diff do ficheiro suprimidas por serem muito extensas
+ 467 - 32
packages/fppkg/Makefile


+ 13 - 13
packages/fppkg/Makefile.fpc

@@ -8,18 +8,18 @@ version=2.5.1
 
 [target]
 units=fprepos fpxmlrep pkgoptions pkgglobals pkgmessages pkghandler pkgmkconv pkgdownload pkgfpmake pkgcommands pkgrepos
-units_linux=pkgwget  
-units_beos=pkgwget 
-units_haiku=pkgwget
-units_freebsd=pkgwget 
-units_netbsd=pkgwget
-nits_openbsd=pkgwget
-units_darwin=pkgwget 
-units_iphonesim=pkgwget 
-units_solaris=pkgwget 
-units_win32=pkgwget 
-units_win64=pkgwget 
-units_wince=pkgwget 
+units_linux=pkgwget pkgfphttp 
+units_beos=pkgwget pkgfphttp
+units_haiku=pkgwget pkgfphttp
+units_freebsd=pkgwget pkgfphttp
+units_netbsd=pkgwget pkgfphttp
+nits_openbsd=pkgwget pkgfphttp
+units_darwin=pkgwget pkgfphttp
+units_iphonesim=pkgwget pkgfphttp
+units_solaris=pkgwget pkgfphttp
+units_win32=pkgwget pkgfphttp
+units_win64=pkgwget pkgfphttp
+units_wince=pkgwget pkgfphttp
 rsts=fprepos fpxmlrep pkgmessages
 
 
@@ -35,7 +35,7 @@ fpcpackage=y
 fpcdir=../..
 
 [require]
-packages=fcl-base fcl-xml fcl-process fcl-net paszlib libcurl
+packages=fcl-base fcl-xml fcl-process fcl-net paszlib libcurl fcl-web
 tools=data2inc
 packages_darwin=univint
 packages_iphonesim=univint

+ 33 - 0
packages/fppkg/src/pkgfphttp.pp

@@ -0,0 +1,33 @@
+{$mode objfpc}
+{$h+}
+unit pkgfphttp;
+
+interface
+
+uses Classes,pkgdownload,pkgoptions,fprepos;
+
+Type
+  TFPHTTPDownloader = Class(TBaseDownloader)
+  Protected
+    Procedure HTTPDownload(Const URL : String; Dest : TStream); override;
+ end;
+
+implementation
+
+uses
+  sysutils,fphttpclient, pkgglobals, pkgmessages;
+
+Procedure TFPHTTPDownloader.HTTPDownload(Const URL : String; Dest : TStream);
+
+begin
+  With TFPHTTPClient.Create(Nil) do
+    try
+      Get(URL,Dest);
+    finally
+      Free;
+    end;
+end;
+
+initialization
+  RegisterDownloader('FPC',TFPHTTPDownloader);
+end.

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff