The _autoload function loads the folder many, the website traffic is big, then to the speed influence big, how should solve
Source: Internet
Author: User
The __autoload function loads the folder many, the website traffic is big, then to the speed influence big?
The __autoload function loads the folder many, the website traffic is big, then to the speed influence big!
function __autoload ($className) {
if (file_exists (' model/'. $className. Class.php ')) {
Include_once (' model/'. $className. Class.php ');
}
if (file_exists (' controller/'. $className. Class.php ')) {
Include_once (' controller/'. $className. Class.php ');
}
------Solution--------------------
I don't think it's much of a __autoload, because it's just a call to __autoload to load multiple files instead of calling __autoload multiple times to load several files.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.