[BUGFIX] Extension Import not working with postgresql and DBAL
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Classes / LanguageCacheClearer.php
1 <?php
2 namespace TYPO3\CMS\Lang;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2008-2011 Dominique Feyer <dominique.feyer@reelpeek.net>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * Class to clear temp files of htmlArea RTE
31 *
32 * @author Dominique Feyer <dominique.feyer@reelpeek.net>
33 * @package TYPO3
34 * @subpackage tx_Lang
35 */
36 class LanguageCacheClearer {
37
38 /**
39 * @var \TYPO3\CMS\Core\Cache\Frontend\StringFrontend
40 */
41 protected $cacheInstance;
42
43 /**
44 * Constructor
45 */
46 public function __construct() {
47 $this->initializeCache();
48 }
49
50 /**
51 * Initialize cache instance to be ready to use
52 *
53 * @return void
54 */
55 protected function initializeCache() {
56 $this->cacheInstance = $GLOBALS['typo3CacheManager']->getCache('t3lib_l10n');
57 }
58
59 /**
60 * Flush the l10n cache
61 *
62 * @return void
63 */
64 public function clearCache() {
65 if (isset($GLOBALS['BE_USER'])) {
66 $GLOBALS['BE_USER']->writelog(3, 1, 0, 0, '[lang]: User %s has cleared the language cache', array($GLOBALS['BE_USER']->user['username']));
67 }
68 $this->cacheInstance->flush();
69 }
70
71 }
72
73
74 ?>