I18nHandler now cleans up language cache and compiled templates
authorAlexander Ebert <ebert@woltlab.com>
Tue, 27 Sep 2011 13:20:03 +0000 (15:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 27 Sep 2011 13:20:03 +0000 (15:20 +0200)
Closes #195

wcfsetup/install/files/lib/system/language/I18nHandler.class.php
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php

index 7b2ce6b9691d15abebd31cefb44b1d6320ffe49f..41f0b5b36658e1654e1608ed970890e05d3e3004 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\language;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
+use wcf\system\language\LanguageFactory;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
 
@@ -218,6 +219,9 @@ class I18nHandler extends SingletonFactory {
                                ));
                        }
                }
+               
+               // reset language cache
+               LanguageFactory::getInstance()->deleteLanguageCache();
        }
        
        /**
@@ -235,6 +239,9 @@ class I18nHandler extends SingletonFactory {
                        $languageVariable,
                        $packageID
                ));
+               
+               // reset language cache
+               LanguageFactory::getInstance()->deleteLanguageCache();
        }
        
        /**
index 7b4ea48460578aefd6e01ac827aa0e2721841a98..66003cb68e82a8c01cf818128643b6ffb1e6f186 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\language;
 use wcf\data\language\Language;
+use wcf\data\language\LanguageEditor;
 use wcf\data\DatabaseObject;
 use wcf\system\cache\CacheHandler;
 use wcf\system\template\TemplateScriptingCompiler;
@@ -300,4 +301,12 @@ class LanguageFactory extends SingletonFactory {
                // rebuild language cache
                $this->clearCache();
        }
+       
+       /**
+        * Removes language cache and compiled templates.
+        */
+       public function deleteLanguageCache() {
+               LanguageEditor::deleteLanguageFiles();
+               LanguageEditor::deleteCompiledTemplates();
+       }
 }