Permalink
Browse files

Moved check_dir_exists function from backup/lib.php to moodlelib

  • Loading branch information...
1 parent 50c38be commit 3c9d0038dd2a4b99269a28ce134dfea7b58159f4 mjollnir_ committed Feb 2, 2006
Showing with 18 additions and 18 deletions.
  1. +0 −18 backup/lib.php
  2. +18 −0 lib/moodlelib.php
View
@@ -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) {
View
@@ -6411,6 +6411,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)) {

0 comments on commit 3c9d003

Please sign in to comment.