Changeset 3576


Ignore:
Timestamp:
07/14/09 02:59:01 (11 years ago)
Author:
patdenice
Message:

After upgrade, delete files from obsolete.list

Location:
extensions/autoupdate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/autoupdate.php

    r3575 r3576  
    4040    if ($result = $zip->extract(PCLZIP_OPT_PATH, PHPWG_ROOT_PATH, PCLZIP_OPT_REMOVE_PATH, $_GET['autoupdate'], PCLZIP_OPT_REPLACE_NEWER)) 
    4141    { 
     42      if (file_exists(PHPWG_ROOT_PATH.'obsolete.list') 
     43        and $old_files = file(PHPWG_ROOT_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES) 
     44        and !empty($old_files)) 
     45      { 
     46        array_push($old_files, 'obsolete.list'); 
     47        foreach($old_files as $old_file) 
     48        { 
     49          $path = PHPWG_ROOT_PATH.$old_file; 
     50          if (is_file($path)) 
     51          { 
     52            @unlink($path); 
     53          } 
     54          elseif (is_dir($path)) 
     55          { 
     56            autoupdate_deltree($path); 
     57          } 
     58        } 
     59      } 
    4260      autoupdate_deltree($conf['local_data_dir'].'/autoupdate'); 
    4361      redirect('admin.php?autoupdate=success'); 
  • extensions/autoupdate/main.inc.php

    r3575 r3576  
    22/* 
    33Plugin Name: Piwigo AutoUpgrade 
    4 Version: 2.0.a 
     4Version: 2.0.b 
    55Description: Upgrade your gallery automatically. 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=302 
Note: See TracChangeset for help on using the changeset viewer.