mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
Merge branch 'MDL-27559-master-v2' of https://github.com/mackensen/moodle
This commit is contained in:
commit
7df271d9b3
6 changed files with 26 additions and 8 deletions
|
@ -8029,7 +8029,10 @@ function get_list_of_plugins($directory='mod', $exclude='', $basedir='') {
|
|||
}
|
||||
|
||||
if (file_exists($basedir) && filetype($basedir) == 'dir') {
|
||||
$dirhandle = opendir($basedir);
|
||||
if (!$dirhandle = opendir($basedir)) {
|
||||
debugging("Directory permission error for plugin ({$directory}). Directory exists but cannot be read.", DEBUG_DEVELOPER);
|
||||
return array();
|
||||
}
|
||||
while (false !== ($dir = readdir($dirhandle))) {
|
||||
$firstchar = substr($dir, 0, 1);
|
||||
if ($firstchar === '.' or $dir === 'CVS' or $dir === '_vti_cnf' or $dir === 'simpletest' or $dir === 'yui' or $dir === 'phpunit' or $dir === $exclude) {
|
||||
|
@ -10225,7 +10228,7 @@ function apd_get_profiling() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete directory or only it's content
|
||||
* Delete directory or only its content
|
||||
*
|
||||
* @param string $dir directory path
|
||||
* @param bool $content_only
|
||||
|
@ -10236,7 +10239,9 @@ function remove_dir($dir, $content_only=false) {
|
|||
// nothing to do
|
||||
return true;
|
||||
}
|
||||
$handle = opendir($dir);
|
||||
if (!$handle = opendir($dir)) {
|
||||
return false;
|
||||
}
|
||||
$result = true;
|
||||
while (false!==($item = readdir($handle))) {
|
||||
if($item != '.' && $item != '..') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue