Autoloading out of the /classes folder is fully PRS-0 compliant in Elgg 1.9 but is quite crude in Elgg 1.8. If you need PSR-0 compatibility in 1.8, you can use this snippet in your plugin's start.php:
// fix autoloading for 1.8 (place this in plugin start.php)
if (version_compare(get_version(true), '1.9', '<')) {
spl_autoload_register(function ($class) {
$pieces = explode('\\', ltrim($class, '\\'));
$pieces[count($pieces) - 1] = strtr($pieces[count($pieces) - 1], '_', '/');
$file = __DIR__ . '/classes/' . implode('/', $pieces) . '.php';
is_readable($file) && (require $file);
});
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.