Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40528

abstract file_storage trashdir code to pluggable content recovery class

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Deferred
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: Files API
    • Testing Instructions:
      Hide

      1/ execute phpunit tests
      2/ try to deleting some files that are not in any draft area (in PHP code most probably) and verify the file goes to the dataroot/trashdir by default

      Show
      1/ execute phpunit tests 2/ try to deleting some files that are not in any draft area (in PHP code most probably) and verify the file goes to the dataroot/trashdir by default
    • Affected Branches:
      MOODLE_25_STABLE

      Description

      Use cases:

      1/ By default everything works as before, the setting defaults to:

       $CFG->file_storage_recovery_classes = array('core_file_storage_trash');
      

      2/ some sites may not want to delete files from $CFG->filedir at all (this helps file-less backups, filedir may be shared by independent moodle instances)

       $CFG->file_storage_recovery_classes = array();
      

      3/ this might be used for continuous external backups

       $CFG->file_storage_recovery_classes = array('core_file_storage_backup');
       $CFG->core_file_storage_backup_filedir = '/some/masterfiledir';
      

      4/ somebody might want to skip the trashdir when deleting files

       $CFG->file_storage_recovery_classes = array('core_file_storage_notrash');
      

      5/ in theory this might be used on cluster nodes where normal $CFG->filedir could be used as local cache only (this is not the primary purpose of this patch)

      6/ this refactoring should also help if anybody decides to reimplement file_storage and stored_file because now it does not have any trashdir logic that might collide with other file storage designs

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Integrator:
              Damyon Wiese
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: