summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/RejectParserCacheValue.php
blob: b2b21af2c4d06a03cc6912d6dac0ec3bd657cde8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

namespace SMW\MediaWiki\Hooks;

use SMW\SQLStore\QueryDependency\DependencyLinksUpdateJournal;
use Title;

/**
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/RejectParserCacheValue
 *
 * @license GNU GPL v2+
 * @since 3.0
 *
 * @author mwjames
 */
class RejectParserCacheValue extends HookHandler {

	/**
	 * @var DependencyLinksUpdateJournal
	 */
	private $dependencyLinksUpdateJournal;

	/**
	 * @since 3.0
	 *
	 * @param DependencyLinksUpdateJournal $dependencyLinksUpdateJournal
	 */
	public function __construct( DependencyLinksUpdateJournal $dependencyLinksUpdateJournal ) {
		$this->dependencyLinksUpdateJournal = $dependencyLinksUpdateJournal;
	}

	/**
	 * @since 3.0
	 *
	 * @param Title $title
	 *
	 * @return boolean
	 */
	public function process( Title $title ) {

		if ( $this->dependencyLinksUpdateJournal->has( $title ) ) {
			$this->dependencyLinksUpdateJournal->delete( $title );
			return false;
		}

		return true;
	}

}