Autoloader::loader( string $className )
Autoload function for registration with spl_autoload_register
Description
Looks recursively through project directory and loads class files based on filename match.
Parameters
- $className
-
(string) (Required)
Source
File: classes/Autoloader.php
public static function loader( $className ) { if ( ! class_exists( $className ) && strpos( $className, "Dozent" ) !== false ) { $className = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $className ); $className = str_replace( 'Dozent' . DIRECTORY_SEPARATOR, '', $className ); $filename = $className . '.php'; $classes_dir = __DIR__; if ( strpos( $className, "/" ) !== false ) { $classes_dir = dirname( __DIR__ ); } $file_path = $classes_dir . DIRECTORY_SEPARATOR . $filename; if ( file_exists( $file_path ) ) { include_once $file_path; } } }