Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Fixing namespace unit test failure #1719

Merged
merged 1 commit into from
Nov 26, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion libraries/loader.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public static function load($class)
$class = strtolower($class); $class = strtolower($class);


// If the class already exists do nothing. // If the class already exists do nothing.
if (class_exists($class)) if (class_exists($class, false))
{ {
return true; return true;
} }
Expand Down Expand Up @@ -239,6 +239,12 @@ public static function load($class)
*/ */
public static function loadByNamespaceLowerCase($class) public static function loadByNamespaceLowerCase($class)
{ {
// If the class already exists do nothing.
if (class_exists($class, false))
{
return true;
}

// Get the root namespace name. // Get the root namespace name.
$namespace = strstr($class, '\\', true); $namespace = strstr($class, '\\', true);


Expand Down Expand Up @@ -280,6 +286,12 @@ public static function loadByNamespaceLowerCase($class)
*/ */
public static function loadByNamespaceNaturalCase($class) public static function loadByNamespaceNaturalCase($class)
{ {
// If the class already exists do nothing.
if (class_exists($class, false))
{
return true;
}

// Get the root namespace name. // Get the root namespace name.
$namespace = strstr($class, '\\', true); $namespace = strstr($class, '\\', true);


Expand Down Expand Up @@ -322,6 +334,12 @@ public static function loadByNamespaceNaturalCase($class)
*/ */
public static function loadByNamespaceMixedCase($class) public static function loadByNamespaceMixedCase($class)
{ {
// If the class already exists do nothing.
if (class_exists($class, false))
{
return true;
}

// Get the root namespace name. // Get the root namespace name.
$namespace = strstr($class, '\\', true); $namespace = strstr($class, '\\', true);


Expand Down