Use the URL provided by the package server when downloading packages
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 17 Jun 2013 12:38:30 +0000 (14:38 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 17 Jun 2013 12:38:30 +0000 (14:38 +0200)
wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php

index 0a55a75481981aa8ce306813dfb9e0e89c374da9..ecfd6c0007a22e1b14a86ba50e9dd10a8c835c38 100644 (file)
@@ -215,15 +215,23 @@ class PackageInstallationScheduler {
                        // get auth data
                        $authData = $this->getAuthData($packageUpdateVersion);
                        
-                       // create request
-                       $request = new HTTPRequest(
-                               $this->packageUpdateServers[$packageUpdateVersion['packageUpdateServerID']]->serverURL,
-                               (!empty($authData) ? array('auth' => $authData) : array()),
-                               array(
-                                       'packageName' => $packageUpdateVersion['package'],
-                                       'packageVersion' => $packageUpdateVersion['packageVersion']
-                               )
-                       );
+                       if ($packageUpdateVersion['filename']) {
+                               $request = new HTTPRequest(
+                                       $packageUpdateVersion['filename'],
+                                       (!empty($authData) ? array('auth' => $authData) : array())
+                               );
+                       }
+                       else {
+                               // create request
+                               $request = new HTTPRequest(
+                                       $this->packageUpdateServers[$packageUpdateVersion['packageUpdateServerID']]->serverURL,
+                                       (!empty($authData) ? array('auth' => $authData) : array()),
+                                       array(
+                                               'packageName' => $packageUpdateVersion['package'],
+                                               'packageVersion' => $packageUpdateVersion['packageVersion']
+                                       )
+                               );
+                       }
                        
                        try {
                                $request->execute();