Changeset 11509


Ignore:
Timestamp:
06/25/11 21:52:18 (8 years ago)
Author:
plg
Message:

merge r11508 from branch 2.2 to trunk

bug 2363 fixed: upgrade 94 should not fail when write access is missing on
_data/plugins. When this situation occurs, we don't save the 2.1 user upload
configuration and we continue the upgrade.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/db/94-database.php

    r8728 r11509  
    6262// save configuration for a future use by the Community plugin 
    6363$backup_filepath = $conf['local_data_dir'].'/plugins/core_user_upload_to_community.php'; 
    64 mkgetdir(dirname($backup_filepath)); 
     64$save_conf = true; 
     65if (is_dir(dirname($backup_filepath))) 
     66{ 
     67  if (!is_writable(dirname($backup_filepath))) 
     68  { 
     69    $save_conf = false; 
     70  } 
     71} 
     72elseif (!is_writable($conf['local_data_dir'])) 
     73{ 
     74  $save_conf = false; 
     75} 
    6576 
    66 file_put_contents( 
    67   $backup_filepath, 
    68   '<?php $user_upload_conf = \''.serialize($user_upload_conf).'\'; ?>' 
    69   ); 
     77if ($save_conf) 
     78{ 
     79  mkgetdir(dirname($backup_filepath)); 
     80 
     81  file_put_contents( 
     82    $backup_filepath, 
     83    '<?php $user_upload_conf = \''.serialize($user_upload_conf).'\'; ?>' 
     84    ); 
     85} 
    7086 
    7187// 
Note: See TracChangeset for help on using the changeset viewer.