1 | <?php |
||
37 | class SiteHashService |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * Resolves magic keywords in allowed sites configuration. |
||
42 | * Supported keywords: |
||
43 | * __solr_current_site - The domain of the site the query has been started from |
||
44 | * __current_site - Same as __solr_current_site |
||
45 | * __all - Adds all domains as allowed sites |
||
46 | * * - Means all sites are allowed, same as no siteHash |
||
47 | * |
||
48 | * @param integer $pageId A page ID that is then resolved to the site it belongs to |
||
49 | * @param string $allowedSitesConfiguration TypoScript setting for allowed sites |
||
50 | * @return string List of allowed sites/domains, magic keywords resolved |
||
51 | */ |
||
52 | public function getAllowedSitesForPageIdAndAllowedSitesConfiguration($pageId, $allowedSitesConfiguration) |
||
62 | |||
63 | /** |
||
64 | * Gets the site hash for a domain |
||
65 | * |
||
66 | * @param string $domain Domain to calculate the site hash for. |
||
67 | * @return string site hash for $domain |
||
68 | */ |
||
69 | public function getSiteHashForDomain($domain) |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Returns a comma separated list of all domains from all sites. |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | protected function getDomainListOfAllSites() |
||
97 | |||
98 | /** |
||
99 | * Retrieves the domain of the site that belongs to the passed pageId and replaces their markers __solr_current_site |
||
100 | * and __current_site. |
||
101 | * |
||
102 | * @param integer $pageId |
||
103 | * @param string $allowedSitesConfiguration |
||
104 | * @return string |
||
105 | */ |
||
106 | protected function getDomainByPageIdAndReplaceMarkers($pageId, $allowedSitesConfiguration) |
||
112 | |||
113 | /** |
||
114 | * @return Site[] |
||
115 | */ |
||
116 | protected function getAvailableSites() |
||
120 | |||
121 | /** |
||
122 | * @param $pageId |
||
123 | * @return Site |
||
124 | */ |
||
125 | protected function getSiteByPageId($pageId) |
||
129 | } |
||
130 |