Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5969944
CacheInvalidator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CacheInvalidator.php
View Options
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace
MediaWiki\GlobalUserPage
;
use
MediaWiki\MediaWikiServices
;
use
MediaWiki\Title\Title
;
class
CacheInvalidator
{
/**
* Username of the user who's userpage needs to be invalidated
*
* @var string
*/
private
$username
;
/**
* Array of string options
*
* @var array
*/
private
$options
;
public
function
__construct
(
$username
,
array
$options
=
[]
)
{
$this
->
username
=
$username
;
$this
->
options
=
$options
;
}
public
function
invalidate
()
{
global
$wgUseCdn
,
$wgUseFileCache
;
if
(
!
$wgUseCdn
&&
!
$wgUseFileCache
&&
!
$this
->
options
)
{
// No CDN and no options means nothing to do!
return
;
}
MediaWikiServices
::
getInstance
()->
getJobQueueGroup
()->
push
(
new
LocalJobSubmitJob
(
Title
::
newFromText
(
'User:'
.
$this
->
username
),
[
'username'
=>
$this
->
username
,
'touch'
=>
in_array
(
'links'
,
$this
->
options
),
]
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 14:06 (10 h, 31 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b0/ca/5a6ec44c2f271ce61a0f10a256c8
Default Alt Text
CacheInvalidator.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment