Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5974104
LocalCacheUpdateJob.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
LocalCacheUpdateJob.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
HTMLFileCache
;
use
Job
;
use
MediaWiki\MediaWikiServices
;
use
MediaWiki\Title\Title
;
/**
* A job that runs on local wikis to purge squid and possibly
* queue local HTMLCacheUpdate jobs
*/
class
LocalCacheUpdateJob
extends
Job
{
/**
* @param Title $title
* @param array $params Should have 'username' and 'touch' keys
*/
public
function
__construct
(
Title
$title
,
array
$params
)
{
parent
::
__construct
(
'LocalGlobalUserPageCacheUpdateJob'
,
$title
,
$params
);
}
public
function
run
()
{
$title
=
Title
::
makeTitleSafe
(
NS_USER
,
$this
->
params
[
'username'
]
);
// We want to purge the cache of the accompanying page so the tabs change colors
$other
=
$title
->
getOtherPage
();
$hcu
=
MediaWikiServices
::
getInstance
()->
getHtmlCacheUpdater
();
$hcu
->
purgeTitleUrls
(
$title
,
$hcu
::
PURGE_INTENT_TXROUND_REFLECTED
);
$hcu
->
purgeTitleUrls
(
$other
,
$hcu
::
PURGE_INTENT_TXROUND_REFLECTED
);
HTMLFileCache
::
clearFileCache
(
$title
);
HTMLFileCache
::
clearFileCache
(
$other
);
if
(
$this
->
params
[
'touch'
]
)
{
$title
->
touchLinks
();
}
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 17:07 (20 h, 14 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
22/a6/46cd5e261ea305c495fab42908a7
Default Alt Text
LocalCacheUpdateJob.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment