summaryrefslogtreecommitdiff
path: root/helpers/autoload.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
commit7076343338ae3439f3c86f01144818abe8c31978 (patch)
tree794abb1e6b8f821091fd095341885496b6dad51d /helpers/autoload.php
parent47cbb529f5723b246125ae083a193e11481b89ef (diff)
downloadclassroom-7076343338ae3439f3c86f01144818abe8c31978.tar.gz
classroom-7076343338ae3439f3c86f01144818abe8c31978.tar.bz2
classroom-7076343338ae3439f3c86f01144818abe8c31978.zip
add container helpers; constuct public directory-tree
Diffstat (limited to 'helpers/autoload.php')
-rw-r--r--helpers/autoload.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/helpers/autoload.php b/helpers/autoload.php
deleted file mode 100644
index c4359c6..0000000
--- a/helpers/autoload.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/** register class-autoloader
- *
- * NOTE:
- * Composer is strongly recommended; it is a much better option
- * and takes care for many more than just autoloading classes;
- *
- * This's a fair autoloader in case composer is not available;
- * supports single and namespaced classes.
- */
-spl_autoload_register(
- function($className) {
-
- // in order to support common namespaced classes
- // replace '\' with '/' to get the path
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
-
- // check all possible classPaths for class
- foreach(CLASSPATHS as $key => $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];
- // }
- }
-);