summaryrefslogtreecommitdiff
path: root/include/autoload.php
blob: 4422a435ca65ffe662109fc640b492d76ce3c816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
	spl_autoload_register(function($class) {

		$root_dir = dirname(__DIR__); // we were in tt-rss/include

		// - 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/

		$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";