29 if (substr($class, 0, 4) !==
'CAS_') {
33 if (empty($include_path)) {
34 $include_path =
array(dirname(dirname(__FILE__)), dirname(dirname(__FILE__)) .
'/../test/' );
39 foreach ($include_path as
$path) {
40 $file_path = $path .
'/' . str_replace(
'_',
'/', $class) .
'.php';
41 $fp = @fopen($file_path,
'r',
true);
45 if (!class_exists($class,
false) && !interface_exists($class,
false)) {
48 'Class ' . $class .
' was not present in ' .
58 'Class ' . $class .
' could not be loaded from ' .
59 $file_path .
', file does not exist (Path="' 60 . implode(
':', $include_path) .
'") [CAS_autoload]' 62 $trace = $e->getTrace();
63 if (isset($trace[2]) && isset($trace[2][
'function'])
64 && in_array($trace[2][
'function'],
array(
'class_exists',
'interface_exists'))
68 if (isset($trace[1]) && isset($trace[1][
'function'])
69 && in_array($trace[1][
'function'],
array(
'class_exists',
'interface_exists'))
77 if (function_exists(
'spl_autoload_register')) {
78 if (!(spl_autoload_functions())
79 || !in_array(
'CAS_autoload', spl_autoload_functions())
81 spl_autoload_register(
'CAS_autoload');
82 if (function_exists(
'__autoload')
83 && !in_array(
'__autoload', spl_autoload_functions())
87 spl_autoload_register(
'__autoload');
90 } elseif (!function_exists(
'__autoload')) {
99 function __autoload($class)
CAS_autoload($class)
Autoload a class.
Create styles array
The data for the language used.