When we have a wordpress or other sites in document root of Magento, we might get some warning like this:
Warning: include(file.php): failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 93
This is because Autoloader tries to map php class name to file and tries to include the file.
The code is like return include $classFile;
We can overide this warning by checking the file using stream_resolve_include_path function. So the modified code will be
if (stream_resolve_include_path($classFile)) {
return include $classFile;
} else {
return false;
}
After this the warning message no longer shows in log. Hope this helps. :)
4 comments:
Wow really usefull post, this is what I was searching on google!!!, thanks alot
Really Nice post. Was useful for many.
Wonderful post.
Is this work on Magento 2 too ?
Post a Comment