From 47cbb529f5723b246125ae083a193e11481b89ef Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 07:01:30 +0200 Subject: initializing classroom structure using anom framework --- helpers/autoload.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 helpers/autoload.php (limited to 'helpers/autoload.php') diff --git a/helpers/autoload.php b/helpers/autoload.php new file mode 100644 index 0000000..c4359c6 --- /dev/null +++ b/helpers/autoload.php @@ -0,0 +1,43 @@ + $basePath) { + + $file = APP_ROOT . $basePath . $classPath .'.php'; + + // if class-file exist, include it + if (file_exists($file)) { + require_once $file; + break; + } + + } + + // // Feel free to extend the fanctionality + // // example: + // // custom (exception) namespaced classes loader + // $customNSclasses = array( + // '\\George\\Class' => 'path/to/George/Class', + // '\\Mary\\Class' => 'path/to/Marias/Class', + // ... + // ); + // if array_key_exists($className) { + // require_once $customNSclasses[$className]; + // } + } +); -- cgit v1.2.3