From da84821329678b84316ec04c123ee8b1d5de7aa0 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Tue, 14 Jun 2011 13:44:12 +0200 Subject: [PATCH] MDL-25461 Installing a language pack is recorded in moodle.org statistics This patch fixes the URLs for fetching data from download.moodle.org so that the requests are recorded in statistics collector download.php. Note that we do not record fetching languages.md5 as we want to record the real .zip downloads only. --- lib/componentlib.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/componentlib.class.php b/lib/componentlib.class.php index 39209bc4ef3..7625d3de0f3 100644 --- a/lib/componentlib.class.php +++ b/lib/componentlib.class.php @@ -665,12 +665,10 @@ class lang_installer { */ public function lang_pack_url($langcode = '') { - $baseurl = 'http://download.moodle.org/langpack/' . $this->version . '/'; - if (empty($langcode)) { - return $baseurl; + return 'http://download.moodle.org/langpack/'.$this->version.'/'; } else { - return $baseurl . $langcode . '.zip'; + return 'http://download.moodle.org/download.php/langpack/'.$this->version.'/'.$langcode.'.zip'; } } @@ -772,7 +770,7 @@ class lang_installer { protected function install_language_pack($langcode) { // initialise new component installer to process this language - $installer = new component_installer('http://download.moodle.org', 'langpack/' . $this->version, + $installer = new component_installer('http://download.moodle.org', 'download.php/direct/langpack/' . $this->version, $langcode . '.zip', 'languages.md5', 'lang'); if (!$installer->requisitesok) {