+
+ // register plugin autoloader if necessary, for namespaced classes ONLY
+ // layout corresponds to tt-rss main /vendor/author/Package/Class.php
+
+ if (file_exists($vendor_dir)) {
+ spl_autoload_register(function($class) use ($vendor_dir) {
+
+ if (strpos($class, '\\') !== FALSE) {
+ list ($namespace, $class_name) = explode('\\', $class, 2);
+
+ if ($namespace && $class_name) {
+ $class_file = "$vendor_dir/$namespace/" . str_replace('\\', '/', $class_name) . ".php";
+
+ if (file_exists($class_file))
+ require_once $class_file;
+ }
+ }
+ });
+ }
+