Changeset 4034 for trunk


Ignore:
Timestamp:
Oct 14, 2009, 5:01:20 PM (15 years ago)
Author:
patdenice
Message:

merge r4033 from branch 2.0 to trunk
Plugins upgrade now delete obsolete files from obsolete.list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/plugins.class.php

    r3716 r4034  
    413413                }
    414414              }
     415              if (file_exists($extract_path.'/obsolete.list')
     416                and $old_files = file($extract_path.'/obsolete.list', FILE_IGNORE_NEW_LINES)
     417                and !empty($old_files))
     418              {
     419                array_push($old_files, 'obsolete.list');
     420                foreach($old_files as $old_file)
     421                {
     422                  $path = $extract_path.'/'.$old_file;
     423                  if (is_file($path))
     424                  {
     425                    @unlink($path);
     426                  }
     427                  elseif (is_dir($path))
     428                  {
     429                    if (!$this->deltree($path))
     430                    {
     431                      $this->send_to_trash($path);
     432                    }
     433                  }
     434                }
     435              }
    415436            }
    416437            else $status = 'extract_error';
Note: See TracChangeset for help on using the changeset viewer.