Changeset 3157
- Timestamp:
- 11/18/2005 11:32:40 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-content/plugins/wp-db-backup.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/wp-db-backup.php
r3154 r3157 17 17 // CHANGE THIS IF YOU WANT TO USE A 18 18 // DIFFERENT BACKUP LOCATION 19 define('WP_BACKUP_DIR', 'wp-content/backup'); 19 20 $rand = substr( md5( md5( DB_PASSWORD ) ), -5 ); 21 22 define('WP_BACKUP_DIR', 'wp-content/backup-' . $rand); 20 23 21 24 define('ROWS_PER_SEGMENT', 100); … … 210 213 nextStep(); 211 214 //--></script> 215 </div> 212 216 '; 213 217 } … … 727 731 echo $feedback; 728 732 } 729 730 if (! is_dir(ABSPATH . $this->backup_dir)) { 731 echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory does not exist!', 'wp-db-backup') . '<br />' . ABSPATH . $this->backup_dir . "</p></div>"; 733 734 // Give the new dirs the same perms as wp-content. 735 $stat = stat( ABSPATH . 'wp-content' ); 736 $dir_perms = $stat['mode'] & 0000777; // Get the permission bits. 737 738 if ( !file_exists( ABSPATH . $this->backup_dir) ) { 739 if ( @ mkdir( ABSPATH . $this->backup_dir) ) { 740 @ chmod( ABSPATH . $this->backup_dir, $dir_perms); 741 } else { 742 echo '<div class="updated error"><p align="center">' . __('WARNING: Your wp-content directory is <strong>NOT</strong> writable! We can not create the backup directory.', 'wp-db-backup') . '<br />' . ABSPATH . "</p></div>"; 732 743 $WHOOPS = TRUE; 733 }elseif (! is_writable(ABSPATH . $this->backup_dir)) { 734 echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable!', 'wp-db-backup') . '<br />' . ABSPATH . $this->backup_dir . "</p></div>"; 735 $WHOOPS = TRUE; 736 } 744 } 745 } 746 747 if ( !is_writable( ABSPATH . $this->backup_dir) ) { 748 echo '<div class="updated error"><p align="center">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable! We can not create the backup directory.', 'wp-db-backup') . '<br />' . ABSPATH . "</p></div>"; 749 } 750 751 if ( !file_exists( ABSPATH . $this->backup_dir . 'index.php') ) { 752 @ touch( ABSPATH . $this->backup_dir . "index.php"); 753 } 754 737 755 echo "<div class='wrap'>"; 738 756 echo '<h2>' . __('Backup', 'wp-db-backup') . '</h2>';
Note: See TracChangeset
for help on using the changeset viewer.