Piwik should use autoload to automatically load the classes.
This would simplify the code, would make loading pages faster, as unecessary includes wouldn’t be loaded, and would greatly increase reusability of the code.
For example, Zend does it via```
see the code on http://www.google.com/codesearch/p?hl=en#1oUPVh-C1Wg/trunk/eval/gx/zendframework/library/Zend/Loader.php&q=%22spl_autoload_register(array($class,%27autoload%27))%3B&l=32
Once implemented we can remove all require_once from all .php files.
The includes for the Piwik_* (core/PluginsFunctions/*) shortcut functions would still be required and could all be merged in one include file.
Suggests it would be as easy as adding this to index.php and piwik.php:
Silly me... RTFM, we would still have to define an autoloader callback to map classes in our namespace to actual files.
vipsoft, this ticket means:
(In ) refs #620 - class renaming for consistency
(In ) fixes #801, fixes #620 - implement autoloader; remove require_once
FrontController.php from ./index.php to test autoloader; add "false"
parameter to all class_exists() calls to not trigger autoloader
Confirming that  was a global search and replace, including tests/*.
(In ) refs #620, refs #803 - refactor autoloader into core/Loader.php (class
Piwik_Loader); remove unnecessary require_once in core/Common.php