_ How can I solve this problem if the autoload function loads many folders and the website traffic is heavy?
Source: Internet
Author: User
The _ autoload function loads many folders, and the website traffic is heavy. does it affect the speed? _ the autoload function loads many folders, and the website traffic is heavy, does it significantly affect the speed! Function _ autoload ($ className) {if (file_exists ('Model/'. $ cl _ autoload function loads a large number of folders, and the website traffic is heavy. does it significantly affect the speed?
_ The autoload function loads many folders, and the website traffic is heavy. does this affect the speed!
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 --------------------
In my opinion, using _ autoload has little impact, because it only calls _ autoload to load multiple files at a time, rather than calling _ autoload to load multiple files multiple times.
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.