Skip to content

Commit

Permalink
Only load the alias when the original class exists
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Mar 22, 2017
1 parent 933366f commit b15e7eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public static function load($class)
// Search the alias class, first none namespaced and then namespaced
$original = array_search($class, self::$classAliases) ? : array_search('\\' . $class, self::$classAliases);

if ($original)
// When we have an original and the class exists an alias should be created
if ($original && class_exists($original))
{
class_alias($original, $class);
}
Expand Down

0 comments on commit b15e7eb

Please sign in to comment.