|
@@ -0,0 +1,22 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+spl_autoload_register(function ($className) {
|
|
|
+ include getClassPath($className) . '.php';
|
|
|
+});
|
|
|
+
|
|
|
+function getClassPath(string $className): string
|
|
|
+{
|
|
|
+ $registeredClasses = [
|
|
|
+ 'App\Controller' => 'Controller',
|
|
|
+ 'App\Config\DBconnect' => 'config/DBconnect',
|
|
|
+ 'App\Model\ModelAbstract' => 'model/ModelAbstract',
|
|
|
+ 'App\Model\Student' => 'model/Student',
|
|
|
+ 'App\Model\Languages' => 'model/Languages',
|
|
|
+ 'App\Repository\RepositoryAbstract' => 'repository/RepositoryAbstract',
|
|
|
+ 'App\Repository\StudentLanguagesRepository' => 'repository/StudentLanguagesRepository',
|
|
|
+ 'App\Repository\StudentRepository' => 'repository/StudentRepository',
|
|
|
+ 'App\Repository\LanguagesRepository' => 'repository/LanguagesRepository'
|
|
|
+ ];
|
|
|
+
|
|
|
+ return $registeredClasses[$className];
|
|
|
+}
|