I have a server with many customers on, when I develop I include my init.php in which I have an __autoloader()
function that includes the file with dir_name(__FILE__)."/classes/".$className
for instance.
But yesterday I saw that the server could not find the specific class, I restartat apache and then it worked again.
Every customer has this own init.php... ( and therefore many __autoloads on the same server )
customer1/init.php : holds __autoload() customer1/classes/class.php customer2/init.php : holds __autoload() customer2/classes/class.php
I have not done some tests and I hope someone can answer my question before I try to reproduce the problem, but do you think it is possible for php to take the wrong autoload function when you get 2 or more requests at the same time?
Is spl_autoload_register the solution?
Many thanks for some ideas or brainstorming.