Skip to content

Commit

Permalink
MDL-25461 Installing a language pack is recorded in moodle.org statis…
Browse files Browse the repository at this point in the history
…tics

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.
  • Loading branch information
mudrd8mz committed Jun 14, 2011
1 parent 6911fa1 commit da84821
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/componentlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,10 @@ public function run() {
*/
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';
}
}

Expand Down Expand Up @@ -772,7 +770,7 @@ protected function get_parent_language($langcode) {
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) {
Expand Down

0 comments on commit da84821

Please sign in to comment.