diff options
author | Andrew Dolgov <[email protected]> | 2021-03-05 21:14:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-05 21:14:35 +0300 |
commit | 2b8b845abe7c13ecbb266613910484310cffe8e1 (patch) | |
tree | 90bd2e93737c2aad17cfb09496cc57cf3f9968cd /include/autoload.php | |
parent | b2341679d53b227fc90fba34c3a7e6453e3cad6e (diff) |
* use ORM for trivial queries
* environment-based configuration
* useradm.php -> update.php with new options
* support for schema migrations
* various fixes
Diffstat (limited to 'include/autoload.php')
-rw-r--r-- | include/autoload.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/autoload.php b/include/autoload.php new file mode 100644 index 0000000..de80241 --- /dev/null +++ b/include/autoload.php @@ -0,0 +1,16 @@ +<?php + spl_autoload_register(function($class) { + + $root_dir = dirname(__DIR__); // we were in include/ + + // - internal classes are loaded from classes/ and use special naming logic instead of namespaces + + $class_file = "$root_dir/classes/" . str_replace("_", "/", strtolower($class)) . ".php"; + + if (file_exists($class_file)) + include $class_file; + + }); + + // also pull composer autoloader + require_once "vendor/autoload.php"; |