2013-04-17 11:36:34 +00:00
|
|
|
<?php
|
2017-05-27 15:52:16 +00:00
|
|
|
spl_autoload_register(function($class) {
|
2018-07-18 10:25:18 +00:00
|
|
|
|
2021-02-26 16:16:17 +00:00
|
|
|
$root_dir = dirname(__DIR__); // we were in tt-rss/include
|
2013-04-17 11:36:34 +00:00
|
|
|
|
2021-02-26 16:16:17 +00:00
|
|
|
// - internal tt-rss classes are loaded from classes/ and use special naming logic instead of namespaces
|
|
|
|
// - plugin classes are loaded by PluginHandler from plugins.local/ and plugins/
|
2013-04-17 11:36:34 +00:00
|
|
|
|
2021-02-26 16:16:17 +00:00
|
|
|
$class_file = "$root_dir/classes/" . str_replace("_", "/", strtolower($class)) . ".php";
|
2013-04-17 11:36:34 +00:00
|
|
|
|
2018-06-20 11:58:09 +00:00
|
|
|
if (file_exists($class_file))
|
|
|
|
include $class_file;
|
|
|
|
|
2017-05-27 15:52:16 +00:00
|
|
|
});
|
2021-02-26 16:16:17 +00:00
|
|
|
|
|
|
|
// also pull composer autoloader
|
|
|
|
require_once "vendor/autoload.php";
|