New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSR-4 approach acceptable? #317
base: master
Are you sure you want to change the base?
Conversation
@gohanman thanks for your contribution. Yes, that is the general idea. However, before you spend too much time converting the files, please note that I have a work in progress (currently not in a publicly available branch), to add and standardize PHPDoc blocks that would likely cause a large number of merge conflicts. I would also like to have a discussion regarding the namespaces before moving forward. If you have already given this some thought, please share your conclusions. |
RE: namespaces: I can see at least two options: dividing by base class e.g. For backward compatibility it's probably worth allowing exceptions to PSR-1 naming conventions. Having some lowercase class names like |
I haven't thought this all the way through, but it seems to me that dividing by driver offers the advantage of regrouping all code for that driver in a single directory, i.e. under I am fine with keeping "global" classes in the root namespace for now, I agree that there is not much added value to use With regards to BC and making exceptions to the PSR standard, I wouldn't worry about it too much considering that it should be fairly simple to provide compatibility within the ADONewConnection function. Speaking of that, I was thinking of moving some of the functionality currently provided via standalone functions into a generic ADOdb class, so instead of |
OK. With the driver route, what's your opinion on closely related drivers - i.e., does |
A lot of these "related drivers" are legacy things that should be refactored. In the case of PostgreSQL, since the earliest supported version as of this writing is 9.2 (EOL in Sept 2017), the plan was to merge all the drivers into a single class. And if we do end up needing a specialized class for version-specific functionality, I think it would make sense to have it in the |
Checking in if this is a reasonable approach to chipping away at #192 - take a file containing multiple classes, lift one out into its own file, and namespace it.