mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-50788 classloader: Prevent cryptic errors on unreadable classes dir
Do not attempt to read an unreadable directory because previously the generated errors were hard to fathom. Thanks to James McQuillan for the basis of the patch.
This commit is contained in:
parent
74fad2ce3d
commit
0496ac6305
@ -651,6 +651,13 @@ $cache = '.var_export($cache, true).';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_readable($fulldir)) {
|
||||
// TODO: MDL-51711 We should generate some diagnostic debugging information in this case
|
||||
// because its pretty likely to lead to a missing class error further down the line.
|
||||
// But our early setup code can't handle errors this early at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
$items = new \DirectoryIterator($fulldir);
|
||||
foreach ($items as $item) {
|
||||
if ($item->isDot()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user