Re: autoload, include_once naming conventions
| From: | Lukas Smith | Date: | Fri, 18 Mar 2005 07:30:05 +0000 |
| Subject: | Re: autoload, include_once naming conventions | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36749@lists.php.net to get a copy of this message | ||
Daniel Convissor wrote:
Yes, the class_exists() will improve performance. But the automatic package name to file name conversion will inevitably run into problems due to misnamed/mislocated packages/classes. This discussion reminds me of the "NameScheme" package that got voted down: http://pear.php.net/pepr/pepr-proposal-show.php?id=82 If we do implement something like this, the method should accept two parameters, the class name and the file name. No magic. Thus, there can be no mistake.If we dont clean those naming conventions then nobody can use __autoload() anyways. To me the naming convention is quite simple: Any public class needs to be in its own file that matches the "_" => "/" style. Classes that should not be intantiated by the users needs to be structured so that the code that may instantiate that class already includes that class or that file also needs to match the "_" => "/" naming style. Alot of people have been working on cleaning up their code. We still have a few problem packages like "Var_Dump" etc .. It all seems quite fixable to me. regards, Lukas