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.
This commit is contained in:
David Mudrak
2011-06-14 13:49:09 +02:00
parent 6911fa130b
commit da84821329
+3 -5
View File
@@ -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) {