Cleanup: Updated copyright comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / hooks / class.tx_indexedsearch_tslib_fe_hook.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009-2011 Oliver Hader <oliver@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * Hooks for tslib_fe (TSFE).
27 *
28 * $Id$
29 *
30 * @author Oliver Hader <oliver@typo3.org>
31 * @package TYPO3
32 * @subpackage tx_indexedsearch
33 */
34 class tx_indexedsearch_tslib_fe_hook {
35 /**
36 * Frontend hook: If the page is not being re-generated this is our chance to force it to be (because re-generation of the page is required in order to have the indexer called!)
37 *
38 * @param array Parameters from frontend
39 * @param object TSFE object (reference under PHP5)
40 * @return void
41 */
42 public function headerNoCache(array &$params, $ref) {
43 // Requirements are that the crawler is loaded, a crawler session is running and re-indexing requested as processing instruction:
44 if (t3lib_extMgm::isLoaded('crawler')
45 && $params['pObj']->applicationData['tx_crawler']['running']
46 && in_array('tx_indexedsearch_reindex', $params['pObj']->applicationData['tx_crawler']['parameters']['procInstructions'])) {
47
48 // Setting simple log entry:
49 $params['pObj']->applicationData['tx_crawler']['log'][] = 'RE_CACHE (indexed), old status: '.$params['disableAcquireCacheData'];
50
51 // Disables a look-up for cached page data - thus resulting in re-generation of the page even if cached.
52 $params['disableAcquireCacheData'] = TRUE;
53 }
54 }
55 }
56 ?>