Skip to content

Commit 6810c78

Browse files
authored
Autoload without hiding errors (#2300)
1 parent 5e98099 commit 6810c78

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Varien/Autoload.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public static function register()
5757
*/
5858
public function autoload($class)
5959
{
60-
return @include str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class))) . '.php';
60+
$path = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class))) . '.php';
61+
/** @see https://stackoverflow.com/a/5504486/716029 */
62+
$found = stream_resolve_include_path($path);
63+
if ($found !== false) {
64+
return include $found;
65+
}
6166
}
6267
}

0 commit comments

Comments
 (0)