Answer the question
In order to leave comments, you need to log in
How does file auto-upload work in PHP?
Hello! Now I'm implementing class autoloading for the project. I use the spl_autoload_register function to load classes. I have a following question. For example, in the yii2 framework, I can create an arbitrary folder in the project, a file in this folder, and describe the class in this file. Next, I write a namespace in this class and it becomes available from the entire project. Suppose all ALREADY created folders in the project, I can sort through the spl_autoload_register function, but what should I do if the programmer will CREATE folders himself in the future? Should I parse folders throughout the project to find the class file I need? How can I implement the same thing that already exists, for example, in yii2 and do it elegantly?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question