Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
ebe2fafa
Commit
ebe2fafa
authored
Dec 05, 2017
by
Andrew Nicols
Committed by
jun
Dec 06, 2017
Browse files
Merge branch 'wip-MDL-37757-master' of
git://github.com/abgreeve/moodle
parents
713a2cbb
33e385a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
repository/lib.php
View file @
ebe2fafa
...
...
@@ -2004,6 +2004,8 @@ abstract class repository implements cacheable_object {
global
$DB
;
if
(
$downloadcontents
)
{
$this
->
convert_references_to_local
();
}
else
{
$this
->
remove_files
();
}
cache
::
make
(
'core'
,
'repositories'
)
->
purge
();
try
{
...
...
@@ -2668,6 +2670,17 @@ abstract class repository implements cacheable_object {
}
}
/**
* Find all external files linked to this repository and delete them.
*/
public
function
remove_files
()
{
$fs
=
get_file_storage
();
$files
=
$fs
->
get_external_files
(
$this
->
id
);
foreach
(
$files
as
$storedfile
)
{
$storedfile
->
delete
();
}
}
/**
* Function repository::reset_caches() is deprecated, cache is handled by MUC now.
* @deprecated since Moodle 2.6 MDL-42016 - please do not use this function any more.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment