ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
_autoload.php File Reference

Go to the source code of this file.

Namespaces

 SimpleSAMLphp
 Temporary autoloader to ensure compatibility with old, non-PSR-2 compliant classes.
 

Functions

 SAML2_autoload ($className)
 Autoload function that looks for classes migrated to PSR-2. More...
 

Function Documentation

◆ SAML2_autoload()

SAML2_autoload (   $className)

Autoload function that looks for classes migrated to PSR-2.

Parameters
string$classNameName of the class.

Definition at line 15 of file _autoload.php.

16 {
17  // handle classes that have been renamed
18  $renamed = array(
19  'SAML2_Const' => 'SAML2_Constants',
20  );
21  $oldName = $className;
22  if (array_key_exists($className, $renamed)) {
23  $className = $renamed[$className];
24  }
25 
26  $file = dirname(__FILE__).'/'.str_replace('_', '/', $className).'.php';
27  if (file_exists($file)) {
28  require_once($file);
29  $newName = '\\'.str_replace('_', '\\', $className);
30  class_alias($newName, $oldName);
31  }
32 
33 }