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

Refactor various recursive directory delete functions into one and make it much faster

    XMLWordPrintable

Details

    Description

      While testing MDL-69088 we found that there are a bunch of functions that do more or less the same thing:

      lib/filelib.php fulldelete()

      lib/moodlelib.php remove_dir()

      backup/cc/cc_lib/gral_lib/pathutils.php:403:function rmdirr($dirname)

      There are all also very slow at scale because they process all the files recursively directly in php.

      I'm proposing:

      a) pick one and refactor the others to just call it, and deprecate them

      b) In a similar way to pathtodu have an option to use a cli variant which unlinks the directory outside of php land which should be more or less instant.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brendanheywood Brendan Heywood
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: