diff options
author | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-03-09 15:35:46 +0100 |
---|---|---|
committer | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-03-09 15:35:46 +0100 |
commit | cbe01a34349d2f8d123c885184af47c8048ac6f1 (patch) | |
tree | 984956b96c6819bbf011b6146c985eadfd6fb902 /lib/SimpleSAML/Module.php | |
parent | b5648358afea9c52afb94b631cbdf4194ec18763 (diff) | |
download | simplesamlphp-cbe01a34349d2f8d123c885184af47c8048ac6f1.zip simplesamlphp-cbe01a34349d2f8d123c885184af47c8048ac6f1.tar.gz simplesamlphp-cbe01a34349d2f8d123c885184af47c8048ac6f1.tar.bz2 |
Add support for interfaces in our temporary autoloaders, not only for classes.
Diffstat (limited to 'lib/SimpleSAML/Module.php')
-rw-r--r-- | lib/SimpleSAML/Module.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php index c9ff286..515f4ab 100644 --- a/lib/SimpleSAML/Module.php +++ b/lib/SimpleSAML/Module.php @@ -42,14 +42,15 @@ class Module } require_once($file); - if (!class_exists($className, false)) { + if (!class_exists($className, false) && !interface_exists($className, false)) { // the file exists, but the class is not defined. Is it using namespaces? $nspath = join('\\', $path); - if (class_exists('SimpleSAML\Module\\'.$module.'\\'.$nspath)) { + if (class_exists('SimpleSAML\Module\\'.$module.'\\'.$nspath) || + interface_exists('SimpleSAML\Module\\'.$module.'\\'.$nspath)) { // the class has been migrated, create an alias and warn about it \SimpleSAML\Logger::warning( - "The class '$className' is now using namespaces, please use 'SimpleSAML\\Module\\$module\\". - "$nspath' instead." + "The class or interface '$className' is now using namespaces, please use 'SimpleSAML\\Module\\". + $module."\\".$nspath."' instead." ); class_alias("SimpleSAML\\Module\\$module\\$nspath", $className); } |