mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Create missing directories too.
This commit is contained in:
parent
1ca9c0a45a
commit
33c35e6c30
@ -112,6 +112,17 @@ Based on: lang.php in 1.4.3+ release
|
||||
if (!empty($currentfile)) {
|
||||
|
||||
if (!file_exists("$langdir/$currentfile")) {
|
||||
//check if directory exist
|
||||
$pathparts = explode('/',$currentfile);
|
||||
$checkpath = $langdir;
|
||||
for ($a=0; $a < count($pathparts)-1 ; $a++) {
|
||||
$checkpath .= "/".$pathparts[$a];
|
||||
if(!file_exists($checkpath)){
|
||||
if(!mkdir($checkpath)){
|
||||
echo ("Cannot create directory: $checkpath");
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// file doesn't exist - let's check webserver's permission to create it
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user