Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

In autoloader setup, use RuntimeException, and check class loading, n…

…ot file return value.
  • Loading branch information...
commit 9b69d43b934182f01b60702876065f18a9ba85a5 1 parent 720842f
@mrclay mrclay authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 engine/lib/autoloader.php
View
7 engine/lib/autoloader.php
@@ -26,7 +26,7 @@ function _elgg_services() {
* We can't load this from dataroot because we don't know it yet, and we'll need
* several classes before we can find out!
*
- * @throws Exception
+ * @throws RuntimeException
* @access private
*/
function _elgg_create_service_provider() {
@@ -35,8 +35,9 @@ function _elgg_create_service_provider() {
foreach (array('Elgg_ClassMap', 'Elgg_ClassLoader', 'Elgg_AutoloadManager') as $class) {
if (!class_exists($class)) {
$file = "{$dir}/" . strtr($class, '_\\', '//') . ".php";
- if (!include $file) {
- throw new Exception("Could not load {$file}");
+ include $file;
+ if (!class_exists($class, false)) {
+ throw new RuntimeException("Could not load {$class} in {$file}.");
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.