MDL-23984 using standard checkdirexists for lang packs
authorPetr Skoda <skodak@moodle.org>
Sun, 29 Aug 2010 09:38:08 +0000 (09:38 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 29 Aug 2010 09:38:08 +0000 (09:38 +0000)
admin/langimport.php
admin/report/customlang/locallib.php

index c754139..a01068e 100755 (executable)
@@ -65,8 +65,8 @@ $notice_error = array();
 
 if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($pack)) {
     set_time_limit(0);
-    @mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions);    //make it in case it's a fresh install, it might not be there
-    @mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
+    check_dir_exists($CFG->dataroot.'/temp/');
+    check_dir_exists($CFG->dataroot.'/lang/');
 
     if (is_array($pack)) {
         $packs = $pack;
@@ -173,8 +173,9 @@ if ($mode == UPDATE_ALL_LANG) {
         }
     }
 
-    @mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions);
-    @mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
+    check_dir_exists($CFG->dataroot.'/temp/');
+    check_dir_exists($CFG->dataroot.'/lang/');
+
     $updated = false;       // any packs updated?
     foreach ($neededlangs as $pack) {
         if ($pack == 'en') {
index 21a2a03..7660675 100644 (file)
@@ -262,7 +262,7 @@ class report_customlang_utils {
         }
         $filepath = $filepath.'/'.$filename;
         if (!is_dir(dirname($filepath))) {
-            mkdir(dirname($filepath), 0755, true);
+            check_dir_exists(dirname($filepath));
         }
 
         if (!$f = fopen($filepath, 'w')) {