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
Move include/dba.php to src/ #5410
Comments
If I have a wish, I'd like that these changes will include particular unittests too. I think this would help us (especially for the fourth step from @annando !) |
I'm not even sure what they would look like, What kind of unit tests are you thinking about? |
Hm.. An idea:
And assertions what it should return in this caeses. It hasn't to be a "real" logic. Just to make sure that the specific methods work as desired. @Rudloff what do you say? Helpful? Other ideas? Or useless? |
How would it help the transition from old-style |
To separate logic errors when using the new style from errors because of the new style itself. It's more for safety and normally nothing "should" happen. But it's easier to find bugs IF something happen :-) |
Of course, I think it's always good to add tests to new code. But in this case, I don't think it is a high priority, because a bug in (For example, |
Hm.. OK.. I thought maybe because of using the DBA class with maybe refactored features, you probably get into a new execution path in the dba. That's why I thought it's good to add unittests before. |
The dba class needn't to be really hard refactored. it is already a class and most functions are named correctly. So normally this shouldn't be a problem. |
So is someone working on this? Or should I take over? Line 319 is |
I'm doing the first step tonight. |
Concerning the replacing of the dba functions here is my suggestion:
The function The strange constructs with using some We should also use centralized functions when there are repeating queries - like the one that fetches the owner to a current user id. The calls to the item table are very special. Here we should only use the calls from the Item class. (Of course with exception from the database calls inside the Item class) If there are complicated joins or other strange constructs, we should have a look at them and replace them with easier calls. Mostly this doesn't make the things slower - but easier to read. |
There ist still |
Absolutely. |
The function |
I'd rather remove the |
Follow-up to #3878
This very impatcful process will be done in four different PRs:
dba
class out ofinclude/dba.php
to\Friendica\Database\dba
(Move \dba to \Friendica\Database\dba #5418)\Friendica\Database\dba
to\Friendica\Database\DBA
(Rename Friendica\Database\dba to Friendica\Database\DBA #5422)\Friendica\Database\DBA
methods (Move DBA to src/ part 3.1: Rename DBA methods #5431 and Move DBA to src/ part 3.2: Remove DBM class #5438)q()
function calls to\Friendica\Database\DBA
methods calls.Per @annando
The text was updated successfully, but these errors were encountered: