Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
TreeCacheKey
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 build
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Repository;
4
5use Flow\Model\UUID;
6use MediaWiki\MediaWikiServices;
7
8class TreeCacheKey {
9
10    /**
11     * Generate the following cache keys
12     *   flow:tree:subtree|parent|rootpath:<object id>:<cache version>
13     * For example:
14     *   flow:tree:parent:srkbd1u0mzz81x51:4.7
15     *
16     * @param string $treeType
17     * @param UUID $id
18     * @return string
19     */
20    public static function build( $treeType, UUID $id ) {
21        global $wgFlowCacheVersion;
22
23        return MediaWikiServices::getInstance()
24            ->getMainWANObjectCache()
25            ->makeGlobalKey(
26                'flow-tree',
27                $treeType,
28                $id->getAlphadecimal(),
29                $wgFlowCacheVersion
30            );
31    }
32}