The last callers themselves were already soft deprecated and the
singleton on UserCache itself was almost unused. The last usage has
been replaced and the method now emits deprecation warnings.
Change-Id: Ic9f5e4f427c0402b6c0e7232bcf1d5f9eec6e73e
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
* In queryLinks(), use the full result cache even if a limit is
specified. Truncate the result in the caller if necessary.
* Remove the confusing boolean parameter from partitionResult(). Make it
always false and fix up the results afterwards. So the batches are
always the inclusive start and end IDs, false is never returned.
* Inject a logger instead of using wfDebug()
* Use private not protected. Defaulting to protected was just a coding
style quirk I had at the time.
* In queryLinks(), use early return.
* In hooks BacklinkCacheGetConditionsHook and BacklinkCacheGetPrefixHook
adjust the parameter type hint to avoid the need for a Phan override.
Change-Id: Ia53f494633affe48316f0a8b63d03596239ad53c
If a template is created, and then used on a page, and then the template
is updated, all within an hour, then the page_touched of the page is
never updated and the user will always see the old template contents.
This is because htmlCacheUpdate jobs are fully suppressed for one hour
following template creation, due to the WAN backlink partition cache.
So:
* Revert 4f3efbf406, so that htmlCacheUpdate jobs always do
something regardless of the state of the partition cache.
* Factor out the job queueing parts of WikiPage::onArticleCreate,
::onArticleDelete and ::onArticleEdit. Instead of queueing a job
unconditionally, check for the existence of backlinks in a post-send
deferred update. If there are none, don't queue the job.
* It's convenient to use BacklinkCache::hasLinks(), however, it suffered
from the same stale cache problem as BacklinkCache::partition(). It's
a short and fast query, and code review shows that none of the callers
are particularly performance sensitive. So, do not use the WAN cache
in BacklinkCache::hasLinks().
* Since hasLinks() and getNumLinks() no longer share a significant
amount of code, separate them. Remove the $max parameter from
getNumLinks(), which only existed to support hasLinks() and has no
other usages in codesearch.
* Log a debug message when entering the post-send request stage, so that
it's easier to confirm that no additional pre-send queries are done.
* Add a regression test, confirmed to previously fail.
Bug: T368006
Change-Id: Id5c7af6d4fcdbeb6724a9036133742c5f76624df
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
Fix the real issues found by this sniff, and convert the remaining
false positive ignores to per-line ignores so that any more real issues
won't be added.
Change-Id: I18e75d59df327e2d93a3a487c115e92b9f268722
For readability. Allowed since PHP 7.4.
I searched for integer literals of 6 or more digits, and also changed
some nearby smaller numbers for consistency.
Bug: T353205
Change-Id: I8518e04889ba8fd52e0f9476a74f8e3e1454b678
There are a couple of user options related classes already,
and the T321527 work on dynamic defaults is going to add
even more. Let's move them into a separate namespace
to make core a bit more organized.
Old name is kept as an alias for compatibility purposes.
Bug: T321527
Bug: T352284
Change-Id: I9822eb1553870b876d0b8a927e4e86c27d83bd52
* Follows-up I00813228e177a7a7, which removed the "valid username" check,
but getGenderOf() still referred to this check. The fallback in
getGenderOf seems fine and cleaner to keep but no longer needs to
mention this outdated implementation detail.
* Simplify newSelectQueryBuilder call by moving the caller() value
and turn it into a single chain.
* Document why missLimit isn't a constant.
Change-Id: I5791bfdf5b234f266812a478904bf3e7b1dc2313
I fixed some edge cases in the script that migrates to SQB and it
managed to fix these now.
Bug: T344971
Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
These are not too complicated to require their own query builder or
playing with hooks but too complicated for the automated script to do it
cleanly.
Bug: T311866
Change-Id: Ib3ca9cc2a046b03748db0f2eb8bfbb31de641c07
When I was testing for caching in RL, I realized file cache is
completely broken and mostly useless, specially for not taking into
account new query parameters and thinking basically all RL modules are
uncachable.
Let's just remove this.
Bug: T330576
Change-Id: I5b17bfc4c5543bd0e96e1099c87341ddf8fd6572
BacklinkCache::get(), ::getLinks(), ::getCascadeProtectedLinks()
have been removed from core. No longer used.
Change-Id: I84d743719e08c755dc98777ecf6d6d1e92eb2d2b
What this piece of code does: Collect the page names (without a
namespace) from all namespaces that support a gender discinction.
These are usually the User: and User_talk: namespaces.
In other words: No matter if the input contains "User:Foo" or
"User_talk:Foo" or both, we want the output to contain the user name
"Foo" a single time.
We can just combine the incoming per-namespace arrays with + or
array_merge (doesn't make a difference here, but + is actually a lot
faster).
Change-Id: Ia616d3c3db509c4a02ef6806321ef8ae39ede640
Motivation:
* Avoid code duplication.
* Hopefully make it easier to read.
* Also order stuff from cheap to expensive, if possible.
Change-Id: I575e3f2027ce60a0d0885be5b9bd3e07bc035eee
IDatabase::makeWhereFrom2d no longer returns false (it throws),
so do the check in the calling code and return false
Bug: T336964
Follow-Up: Ifdf3ea54271ea856f2f555a5e087b8f521e348b3
Change-Id: I665c3a6e8d8623ace6a5df4e110527db2f546b30
The Hooks class contains deprecated functions and the whole class is
going to get removed, so remove the convenience function and inline the
code.
Bug: T335536
Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
A bit of a clean up. Switching out of lbFactory to ICP is not possible
at the moment because there is $this->lbFactory->getLocalDomainID()
for cache prefix. Fixable later.
Bug: T330641
Change-Id: I2d4537f75f5877552c6d9fd2b76c5be1959ea400