25use InvalidArgumentException;
42 public const AUDIENCE_PUBLIC =
'public';
79 public function search( $audience,
string $search,
int $limit,
int $offset = 0 ): array {
81 wfDeprecated( __METHOD__ .
' with a UserIdentity',
'1.37' );
82 $audience = $this->userFactory->newFromUserIdentity( $audience );
85 if ( $audience !== self::AUDIENCE_PUBLIC &&
88 throw new InvalidArgumentException(
89 '$audience must be AUDIENCE_PUBLIC or an Authority object'
94 $prefix = $this->userNameUtils->getCanonical( $search ) ?:
'';
99 $conds = [
'user_name ' .
$dbr->buildLike( $prefix,
$dbr->anyString() ) ];
103 if ( $audience === self::AUDIENCE_PUBLIC || !$audience->isAllowed(
'hideuser' ) ) {
104 $tables[] =
'ipblocks';
105 $conds[
'ipb_deleted'] = [ 0, null ];
106 $joinConds[
'ipblocks'] = [
'LEFT JOIN',
'user_id=ipb_user' ];
116 'ORDER BY' =>
'user_name',
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(ini_get('mbstring.func_overload')) if(!defined('MW_ENTRY_POINT'))
Pre-config setup: Before loading LocalSettings.php.