I am wondering how magento detects classes present in core, community, local and lib folders without actually mentioning the entire path. On checking this I looked at the father of all magento classes - app/Mage.php. The below statements seem to set the include path:
* Set include path
$paths = BP . DS . 'app' . DS . 'code' . DS . 'local';
$paths = BP . DS . 'app' . DS . 'code' . DS . 'community';
$paths = BP . DS . 'app' . DS . 'code' . DS . 'core';
$paths = BP . DS . 'lib';
$app_path = implode(PS, $paths);
set_include_path($app_path . PS . Mage::registry('original_include_path'));
But this should mean that any class in these folders should get detected by magento, right?? So I went ahead and placed a new class inside apps/code/local (placed a random PHP class). I tried to access this PHP class from elsewhere in magento, say, a phtml file (template) and found that magento was not able to detect this :(.
I am still wondering how magento detects its core classes in the flow. Any pointers welcome .