Skip to content

Commit

Permalink
Merged from MOODLE_15_STABLE: Moved check_dir_exists function from ba…
Browse files Browse the repository at this point in the history
…ckup/lib.php to moodlelib
  • Loading branch information
mjollnir_ committed Feb 2, 2006
1 parent d24e8b2 commit 510b75a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 0 additions & 18 deletions backup/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,6 @@ function backup_delete_old_dirs($delete_from) {
return $status;
}

//Function to check if a directory exists
//and, optionally, create it
function check_dir_exists($dir,$create=false) {

global $CFG;

$status = true;
if(!is_dir($dir)) {
if (!$create) {
$status = false;
} else {
umask(0000);
$status = mkdir ($dir,$CFG->directorypermissions);
}
}
return $status;
}

//Function to check and create the needed dir to
//save all the backup
function check_and_create_backup_dir($backup_unique_code) {
Expand Down
18 changes: 18 additions & 0 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6862,6 +6862,24 @@ function remove_dir($dir, $content_only=false) {
return rmdir($dir);
}

//Function to check if a directory exists
//and, optionally, create it
function check_dir_exists($dir,$create=false) {

global $CFG;

$status = true;
if(!is_dir($dir)) {
if (!$create) {
$status = false;
} else {
umask(0000);
$status = mkdir ($dir,$CFG->directorypermissions);
}
}
return $status;
}

function report_session_error() {
global $CFG, $FULLME;
if (empty($CFG->lang)) {
Expand Down

0 comments on commit 510b75a

Please sign in to comment.